[gnome-builder] vim: fix b B db dB
- From: Sébastien Lafargue <slafargue src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] vim: fix b B db dB
- Date: Fri, 29 Sep 2017 07:20:17 +0000 (UTC)
commit 300769d88b0b575330778e5690900f69c4b8cae4
Author: Sebastien Lafargue <slafargue gnome org>
Date: Fri Sep 29 09:17:20 2017 +0200
vim: fix b B db dB
This is the correct fix for the introduced b B prob.
It was a missing get_char call.
We also fix db dB that was previously set to word end.
src/libide/keybindings/vim.css | 4 ++--
src/libide/sourceview/ide-source-view-movements.c | 10 ++--------
src/libide/sourceview/ide-text-iter.c | 1 +
3 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/src/libide/keybindings/vim.css b/src/libide/keybindings/vim.css
index ed8aee6..76ef350 100644
--- a/src/libide/keybindings/vim.css
+++ b/src/libide/keybindings/vim.css
@@ -1281,13 +1281,13 @@
"clear-count" () };
bind "b" { "begin-macro" ()
- "movement" (previous-word-end-newline-stop, 1, 1, 1)
+ "movement" (previous-word-start-newline-stop, 1, 1, 1)
"copy-clipboard" ()
"delete-selection" ()
"end-macro" () };
bind "<shift>b" { "begin-macro" ()
- "movement" (previous-full-word-end-newline-stop, 1, 1, 1)
+ "movement" (previous-full-word-start-newline-stop, 1, 1, 1)
"copy-clipboard" ()
"delete-selection" ()
"end-macro" () };
diff --git a/src/libide/sourceview/ide-source-view-movements.c
b/src/libide/sourceview/ide-source-view-movements.c
index e3bb37e..9ac0ad5 100644
--- a/src/libide/sourceview/ide-source-view-movements.c
+++ b/src/libide/sourceview/ide-source-view-movements.c
@@ -1569,10 +1569,7 @@ ide_source_view_movements_previous_word_start (Movement *mv)
copy = mv->insert;
- if (mv->newline_stop)
- _ide_text_iter_backward_word_start (&mv->insert, TRUE);
- else
- _ide_source_iter_backward_visible_word_start (&mv->insert);
+ _ide_text_iter_backward_word_start (&mv->insert, mv->newline_stop);
/*
* Vim treats an empty line as a word.
@@ -1592,10 +1589,7 @@ ide_source_view_movements_previous_full_word_start (Movement *mv)
copy = mv->insert;
- if (mv->newline_stop)
- _ide_text_iter_backward_WORD_start (&mv->insert, TRUE);
- else
- _ide_source_iter_backward_full_word_start (&mv->insert);
+ _ide_text_iter_backward_WORD_start (&mv->insert, mv->newline_stop);
/*
* Vim treats an empty line as a word.
diff --git a/src/libide/sourceview/ide-text-iter.c b/src/libide/sourceview/ide-text-iter.c
index 434bf0a..1f8c9cc 100644
--- a/src/libide/sourceview/ide-text-iter.c
+++ b/src/libide/sourceview/ide-text-iter.c
@@ -564,6 +564,7 @@ _ide_text_iter_backward_classified_start (GtkTextIter *iter,
if (!_ide_text_iter_backward_classified_end (iter, classify))
return FALSE;
+ ch = gtk_text_iter_get_char (iter);
begin_class = classify (ch);
if (begin_class == CLASS_NEWLINE)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]