[gtksourceview/wip/chergert/vim] remove capture vfunc
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/vim] remove capture vfunc
- Date: Sat, 6 Nov 2021 20:37:53 +0000 (UTC)
commit 0bbd1166c352e238ec3f0e8d18b5b96ae9d4162b
Author: Christian Hergert <chergert redhat com>
Date: Sat Nov 6 13:37:48 2021 -0700
remove capture vfunc
we didn't end up needing this for text history, so just remove it as it
creates an unnecessary depth traversal
gtksourceview/vim/gtk-source-vim-insert.c | 11 -----------
gtksourceview/vim/gtk-source-vim-state.c | 27 ---------------------------
gtksourceview/vim/gtk-source-vim-state.h | 4 ----
gtksourceview/vim/gtk-source-vim.c | 7 -------
4 files changed, 49 deletions(-)
---
diff --git a/gtksourceview/vim/gtk-source-vim-insert.c b/gtksourceview/vim/gtk-source-vim-insert.c
index 15ec7320..43986fe9 100644
--- a/gtksourceview/vim/gtk-source-vim-insert.c
+++ b/gtksourceview/vim/gtk-source-vim-insert.c
@@ -92,16 +92,6 @@ clear_to_first_char (GtkSourceVimInsert *self)
return TRUE;
}
-static gboolean
-gtk_source_vim_insert_capture (GtkSourceVimState *state,
- GdkEvent *event)
-{
- g_assert (GTK_SOURCE_IS_VIM_INSERT (state));
- g_assert (event != NULL);
-
- return FALSE;
-}
-
static gboolean
gtk_source_vim_insert_handle_event (GtkSourceVimState *state,
GdkEvent *event)
@@ -446,7 +436,6 @@ gtk_source_vim_insert_class_init (GtkSourceVimInsertClass *klass)
state_class->command_bar_text = _("-- INSERT --");
state_class->append_command = gtk_source_vim_insert_append_command;
- state_class->capture = gtk_source_vim_insert_capture;
state_class->handle_event = gtk_source_vim_insert_handle_event;
state_class->resume = gtk_source_vim_insert_resume;
state_class->enter = gtk_source_vim_insert_enter;
diff --git a/gtksourceview/vim/gtk-source-vim-state.c b/gtksourceview/vim/gtk-source-vim-state.c
index d2bd25b0..a32cc173 100644
--- a/gtksourceview/vim/gtk-source-vim-state.c
+++ b/gtksourceview/vim/gtk-source-vim-state.c
@@ -1073,33 +1073,6 @@ gtk_source_vim_state_get_registers (GtkSourceVimState *self)
return priv->registers;
}
-gboolean
-gtk_source_vim_state_capture (GtkSourceVimState *self,
- GdkEvent *event)
-{
- GtkSourceVimState *child;
-
- g_return_val_if_fail (GTK_SOURCE_IS_VIM_STATE (self), FALSE);
- g_return_val_if_fail (event != NULL, FALSE);
-
- if (GTK_SOURCE_VIM_STATE_GET_CLASS (self)->capture)
- {
- if (GTK_SOURCE_VIM_STATE_GET_CLASS (self)->capture (self, event))
- {
- return TRUE;
- }
- }
-
- child = gtk_source_vim_state_get_child (self);
-
- if (child != NULL)
- {
- return gtk_source_vim_state_capture (child, event);
- }
-
- return FALSE;
-}
-
const char *
gtk_source_vim_state_get_current_register (GtkSourceVimState *self)
{
diff --git a/gtksourceview/vim/gtk-source-vim-state.h b/gtksourceview/vim/gtk-source-vim-state.h
index f2ddd06a..f980b697 100644
--- a/gtksourceview/vim/gtk-source-vim-state.h
+++ b/gtksourceview/vim/gtk-source-vim-state.h
@@ -45,8 +45,6 @@ struct _GtkSourceVimStateClass
void (*resume) (GtkSourceVimState *self,
GtkSourceVimState *from);
void (*leave) (GtkSourceVimState *self);
- gboolean (*capture) (GtkSourceVimState *self,
- GdkEvent *event);
gboolean (*handle_event) (GtkSourceVimState *self,
GdkEvent *event);
gboolean (*handle_keypress) (GtkSourceVimState *self,
@@ -87,8 +85,6 @@ void gtk_source_vim_state_set_can_repeat (GtkSourceVim
gboolean can_repeat);
void gtk_source_vim_state_begin_user_action (GtkSourceVimState *self);
void gtk_source_vim_state_end_user_action (GtkSourceVimState *self);
-gboolean gtk_source_vim_state_capture (GtkSourceVimState *self,
- GdkEvent *event);
gboolean gtk_source_vim_state_handle_event (GtkSourceVimState *self,
GdkEvent *event);
void gtk_source_vim_state_set_overwrite (GtkSourceVimState *self,
diff --git a/gtksourceview/vim/gtk-source-vim.c b/gtksourceview/vim/gtk-source-vim.c
index 2b90a91c..fdd8878c 100644
--- a/gtksourceview/vim/gtk-source-vim.c
+++ b/gtksourceview/vim/gtk-source-vim.c
@@ -108,13 +108,6 @@ gtk_source_vim_handle_event (GtkSourceVimState *state,
g_clear_handle_id (&self->constrain_insert_source, g_source_remove);
- /* Allow parent states to capture input before current state */
- if (gtk_source_vim_state_capture (state, event))
- {
- ret = TRUE;
- goto finish;
- }
-
current = gtk_source_vim_state_get_current (state);
if (current == state)
goto finish;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]