[gnome-builder] vim: Handle count in delete_to_end
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] vim: Handle count in delete_to_end
- Date: Sun, 5 Oct 2014 21:22:08 +0000 (UTC)
commit 54ec25fa16cf14373169a3cf1b6d39c921757c62
Author: Florian Müllner <fmuellner gnome org>
Date: Sun Oct 5 02:28:18 2014 +0200
vim: Handle count in delete_to_end
'D' is documented to "Delete the characters under the cursor until the
end of the line and [count]-1 more lines". Do that.
https://bugzilla.gnome.org/show_bug.cgi?id=737911
src/editor/gb-editor-vim.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/editor/gb-editor-vim.c b/src/editor/gb-editor-vim.c
index 52d56e5..5a37a44 100644
--- a/src/editor/gb-editor-vim.c
+++ b/src/editor/gb-editor-vim.c
@@ -2869,11 +2869,17 @@ gb_editor_vim_cmd_delete_to_end (GbEditorVim *vim,
guint count,
gchar modifier)
{
+ guint i;
+
g_assert (GB_IS_EDITOR_VIM (vim));
+ count = MAX (1, count);
+
gb_editor_vim_clear_selection (vim);
gb_editor_vim_select_char (vim);
gb_editor_vim_move_line_end (vim);
+ for (i = 1; i < count; i++)
+ gb_editor_vim_move_down (vim);
gb_editor_vim_delete_selection (vim);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]