[gnome-builder] vim: return true from execute_command() if the command was recognized.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] vim: return true from execute_command() if the command was recognized.
- Date: Thu, 9 Oct 2014 05:16:40 +0000 (UTC)
commit 4956b4031745b17757ba35c409a0e918be621ca6
Author: Christian Hergert <christian hergert me>
Date: Tue Oct 7 13:46:57 2014 -0700
vim: return true from execute_command() if the command was recognized.
src/editor/gb-editor-vim.c | 15 +++++++++++----
src/editor/gb-editor-vim.h | 2 +-
2 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/src/editor/gb-editor-vim.c b/src/editor/gb-editor-vim.c
index 61fb915..15b8485 100644
--- a/src/editor/gb-editor-vim.c
+++ b/src/editor/gb-editor-vim.c
@@ -3448,11 +3448,12 @@ gb_editor_vim_search_and_replace (GbEditorVim *vim,
g_free (replace_text);
}
-void
+gboolean
gb_editor_vim_execute_command (GbEditorVim *vim,
const gchar *command)
{
GbEditorVimPrivate *priv;
+ gboolean ret = TRUE;
gchar *copy;
g_return_if_fail (GB_IS_EDITOR_VIM (vim));
@@ -3482,11 +3483,17 @@ gb_editor_vim_execute_command (GbEditorVim *vim,
else if (g_str_has_prefix (copy, "%s"))
gb_editor_vim_search_and_replace (vim, copy + strlen ("%s"));
else
- g_debug (" TODO: Command Execution Support: %s", command);
+ ret = FALSE;
+
+ if (ret)
+ {
+ gb_editor_vim_clear_selection (vim);
+ gb_editor_vim_set_mode (vim, GB_EDITOR_VIM_NORMAL);
+ }
- gb_editor_vim_clear_selection (vim);
- gb_editor_vim_set_mode (vim, GB_EDITOR_VIM_NORMAL);
g_free (copy);
+
+ return ret;
}
static void
diff --git a/src/editor/gb-editor-vim.h b/src/editor/gb-editor-vim.h
index fd96400..ae45fd6 100644
--- a/src/editor/gb-editor-vim.h
+++ b/src/editor/gb-editor-vim.h
@@ -79,7 +79,7 @@ gboolean gb_editor_vim_get_enabled (GbEditorVim *vim);
void gb_editor_vim_set_enabled (GbEditorVim *vim,
gboolean enabled);
GtkWidget *gb_editor_vim_get_text_view (GbEditorVim *vim);
-void gb_editor_vim_execute_command (GbEditorVim *vim,
+gboolean gb_editor_vim_execute_command (GbEditorVim *vim,
const gchar *command);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]