[gnome-builder/wip/vim] editor: remove duplicated commands implemented by VIM mode.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/wip/vim] editor: remove duplicated commands implemented by VIM mode.
- Date: Mon, 29 Sep 2014 23:14:09 +0000 (UTC)
commit c4a63255d2da411df46c6b2d01c4addc4bcc181c
Author: Christian Hergert <christian hergert me>
Date: Mon Sep 29 16:13:48 2014 -0700
editor: remove duplicated commands implemented by VIM mode.
src/editor/gb-editor-commands.c | 204 ---------------------------------
src/resources/keybindings/default.ini | 7 -
2 files changed, 0 insertions(+), 211 deletions(-)
---
diff --git a/src/editor/gb-editor-commands.c b/src/editor/gb-editor-commands.c
index ebaaae5..e12881e 100644
--- a/src/editor/gb-editor-commands.c
+++ b/src/editor/gb-editor-commands.c
@@ -809,35 +809,6 @@ gb_editor_commands_trim_trailing_space (GbEditorWorkspace *workspace,
}
static void
-gb_editor_commands_select_line (GbEditorWorkspace *workspace,
- GbEditorTab *tab)
-{
- GbEditorTabPrivate *priv;
- GtkTextBuffer *buffer;
- GtkTextMark *insert;
- GtkTextIter iter;
- GtkTextIter end;
- guint line;
-
- g_assert (GB_IS_EDITOR_WORKSPACE (workspace));
- g_assert (GB_IS_EDITOR_TAB (tab));
-
- priv = tab->priv;
-
- buffer = GTK_TEXT_BUFFER (priv->document);
-
- insert = gtk_text_buffer_get_insert (buffer);
- gtk_text_buffer_get_iter_at_mark (buffer, &iter, insert);
- line = gtk_text_iter_get_line (&iter);
- gtk_text_buffer_get_iter_at_line (buffer, &iter, line);
- gtk_text_buffer_get_iter_at_line (buffer, &end, line);
- while (!gtk_text_iter_ends_line (&end))
- if (!gtk_text_iter_forward_char (&end))
- break;
- gtk_text_buffer_select_range (buffer, &iter, &end);
-}
-
-static void
gb_editor_commands_move_by (GbEditorWorkspace *workspace,
GbEditorTab *tab,
gdouble amount)
@@ -915,174 +886,6 @@ gb_editor_commands_scroll_up (GbEditorWorkspace *workspace,
}
static void
-gb_editor_commands_move_forward_word (GbEditorWorkspace *workspace,
- GbEditorTab *tab)
-{
- GtkTextBuffer *buffer;
- GtkTextIter iter;
- GtkTextMark *insert;
-
- g_return_if_fail (GB_IS_EDITOR_WORKSPACE (workspace));
- g_return_if_fail (GB_IS_EDITOR_TAB (tab));
-
- buffer = GTK_TEXT_BUFFER (tab->priv->document);
- insert = gtk_text_buffer_get_insert (buffer);
- gtk_text_buffer_get_iter_at_mark (buffer, &iter, insert);
-
- if (!g_unichar_isspace (gtk_text_iter_get_char (&iter)) &&
- !gtk_text_iter_ends_word (&iter))
- if (!gtk_text_iter_forward_word_end (&iter))
- return;
-
- if (!gtk_text_iter_forward_word_end (&iter) ||
- !gtk_text_iter_backward_word_start (&iter))
- gtk_text_buffer_get_end_iter (buffer, &iter);
-
- gtk_text_buffer_select_range (buffer, &iter, &iter);
-
- gtk_text_view_scroll_mark_onscreen (GTK_TEXT_VIEW (tab->priv->source_view),
- insert);
-}
-
-static void
-gb_editor_commands_move_forward (GbEditorWorkspace *workspace,
- GbEditorTab *tab)
-{
- GtkTextBuffer *buffer;
- GtkTextIter iter;
- GtkTextMark *insert;
-
- g_return_if_fail (GB_IS_EDITOR_WORKSPACE (workspace));
- g_return_if_fail (GB_IS_EDITOR_TAB (tab));
-
- buffer = GTK_TEXT_BUFFER (tab->priv->document);
- insert = gtk_text_buffer_get_insert (buffer);
- gtk_text_buffer_get_iter_at_mark (buffer, &iter, insert);
-
- if (!gtk_text_iter_ends_line (&iter) && gtk_text_iter_forward_char (&iter))
- gtk_text_buffer_select_range (buffer, &iter, &iter);
-
- gtk_text_view_scroll_mark_onscreen (GTK_TEXT_VIEW (tab->priv->source_view),
- insert);
-}
-
-static void
-gb_editor_commands_move_backward_word (GbEditorWorkspace *workspace,
- GbEditorTab *tab)
-{
- GtkTextBuffer *buffer;
- GtkTextIter iter;
- GtkTextMark *insert;
-
- g_return_if_fail (GB_IS_EDITOR_WORKSPACE (workspace));
- g_return_if_fail (GB_IS_EDITOR_TAB (tab));
-
- buffer = GTK_TEXT_BUFFER (tab->priv->document);
- insert = gtk_text_buffer_get_insert (buffer);
- gtk_text_buffer_get_iter_at_mark (buffer, &iter, insert);
-
- if (!gtk_text_iter_backward_word_start (&iter))
- gtk_text_buffer_get_start_iter (buffer, &iter);
-
- gtk_text_buffer_select_range (buffer, &iter, &iter);
-
- gtk_text_view_scroll_mark_onscreen (GTK_TEXT_VIEW (tab->priv->source_view),
- insert);
-}
-
-static void
-gb_editor_commands_move_backward (GbEditorWorkspace *workspace,
- GbEditorTab *tab)
-{
- GtkTextBuffer *buffer;
- GtkTextIter iter;
- GtkTextMark *insert;
-
- g_return_if_fail (GB_IS_EDITOR_WORKSPACE (workspace));
- g_return_if_fail (GB_IS_EDITOR_TAB (tab));
-
- buffer = GTK_TEXT_BUFFER (tab->priv->document);
- insert = gtk_text_buffer_get_insert (buffer);
- gtk_text_buffer_get_iter_at_mark (buffer, &iter, insert);
-
- if (!gtk_text_iter_starts_line (&iter) && gtk_text_iter_backward_char (&iter))
- gtk_text_buffer_select_range (buffer, &iter, &iter);
-
- gtk_text_view_scroll_mark_onscreen (GTK_TEXT_VIEW (tab->priv->source_view),
- insert);
-}
-
-static void
-gb_editor_commands_move_up (GbEditorWorkspace *workspace,
- GbEditorTab *tab)
-{
- GtkTextBuffer *buffer;
- GtkTextIter iter;
- GtkTextMark *insert;
- guint line;
- guint line_offset;
- guint i;
-
- g_return_if_fail (GB_IS_EDITOR_WORKSPACE (workspace));
- g_return_if_fail (GB_IS_EDITOR_TAB (tab));
-
- buffer = GTK_TEXT_BUFFER (tab->priv->document);
- insert = gtk_text_buffer_get_insert (buffer);
- gtk_text_buffer_get_iter_at_mark (buffer, &iter, insert);
-
- line = gtk_text_iter_get_line (&iter);
- line_offset = gtk_text_iter_get_line_offset (&iter);
-
- if (line == 0)
- return;
-
- gtk_text_buffer_get_iter_at_line (buffer, &iter, line - 1);
- for (i = 0; i < line_offset; i++)
- if (gtk_text_iter_ends_line (&iter) ||
- !gtk_text_iter_forward_char (&iter))
- break;
-
- gtk_text_buffer_select_range (buffer, &iter, &iter);
-
- gtk_text_view_scroll_mark_onscreen (GTK_TEXT_VIEW (tab->priv->source_view),
- insert);
-}
-
-static void
-gb_editor_commands_move_down (GbEditorWorkspace *workspace,
- GbEditorTab *tab)
-{
- GtkTextBuffer *buffer;
- GtkTextIter iter;
- GtkTextMark *insert;
- guint line;
- guint line_offset;
- guint i;
-
- g_return_if_fail (GB_IS_EDITOR_WORKSPACE (workspace));
- g_return_if_fail (GB_IS_EDITOR_TAB (tab));
-
- buffer = GTK_TEXT_BUFFER (tab->priv->document);
- insert = gtk_text_buffer_get_insert (buffer);
- gtk_text_buffer_get_iter_at_mark (buffer, &iter, insert);
-
- line = gtk_text_iter_get_line (&iter);
- line_offset = gtk_text_iter_get_line_offset (&iter);
-
- gtk_text_buffer_get_iter_at_line (buffer, &iter, line + 1);
- if (gtk_text_iter_get_line (&iter) == (line + 1))
- for (i = 0; i < line_offset; i++)
- if (gtk_text_iter_ends_line (&iter) ||
- !gtk_text_iter_forward_char (&iter))
- break;
-
- gtk_text_buffer_select_range (buffer, &iter, &iter);
-
- gtk_text_view_scroll_mark_onscreen (GTK_TEXT_VIEW (tab->priv->source_view),
- insert);
-}
-
-static void
gb_editor_commands_highlight_mode (GSimpleAction *action,
GVariant *parameter,
GbEditorWorkspace *workspace)
@@ -1163,16 +966,9 @@ gb_editor_commands_init (GbEditorWorkspace *workspace)
{ "reformat", gb_editor_commands_reformat, TRUE },
{ "save", gb_editor_commands_save, TRUE },
{ "save-as", gb_editor_commands_save_as, TRUE },
- { "select-line", gb_editor_commands_select_line, TRUE },
{ "trim-trailing-space", gb_editor_commands_trim_trailing_space, TRUE },
{ "scroll-down", gb_editor_commands_scroll_down, TRUE },
{ "scroll-up", gb_editor_commands_scroll_up, TRUE },
- { "move-forward", gb_editor_commands_move_forward, TRUE },
- { "move-backward", gb_editor_commands_move_backward, TRUE },
- { "move-forward-word", gb_editor_commands_move_forward_word, TRUE },
- { "move-backward-word", gb_editor_commands_move_backward_word, TRUE },
- { "move-up", gb_editor_commands_move_up, TRUE },
- { "move-down", gb_editor_commands_move_down, TRUE },
{ NULL }
};
GSimpleAction *action;
diff --git a/src/resources/keybindings/default.ini b/src/resources/keybindings/default.ini
index 822f8a8..42975f4 100644
--- a/src/resources/keybindings/default.ini
+++ b/src/resources/keybindings/default.ini
@@ -22,12 +22,5 @@ reformat = <Control><Shift>R
save = <Control>S
save-as = <Control><Shift>S
toggle-preview = <Control><Alt>P
-select-line = <Control>L
scroll-up = <Control>Y
scroll-down = <Control>E
-move-up = <Alt>K
-move-down = <Alt>J
-move-forward = <Alt>L
-move-backward = <Alt>H
-move-forward-word = <Alt>W
-move-backward-word = <Alt>B
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]