[gtksourceview/wip/chergert/vim] store reverse search state at the root
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/vim] store reverse search state at the root
- Date: Sun, 7 Nov 2021 02:46:38 +0000 (UTC)
commit 08fb05ccb63e436e136de9a4e227cca742c7de8e
Author: Christian Hergert <chergert redhat com>
Date: Sat Nov 6 19:46:16 2021 -0700
store reverse search state at the root
gtksourceview/vim/gtk-source-vim-state.c | 30 ++++++++++++++++++++++++++++++
gtksourceview/vim/gtk-source-vim-state.h | 3 +++
2 files changed, 33 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-state.c b/gtksourceview/vim/gtk-source-vim-state.c
index 58bfbbaf..6da8a509 100644
--- a/gtksourceview/vim/gtk-source-vim-state.c
+++ b/gtksourceview/vim/gtk-source-vim-state.c
@@ -77,6 +77,7 @@ typedef struct
guint count_set : 1;
guint can_repeat : 1;
guint column_set : 1;
+ guint reverse_search : 1;
} GtkSourceVimStatePrivate;
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GtkSourceVimState, gtk_source_vim_state, G_TYPE_OBJECT)
@@ -1289,3 +1290,32 @@ gtk_source_vim_state_get_search (GtkSourceVimState *self,
*context = priv->search_context;
}
}
+
+gboolean
+gtk_source_vim_state_get_reverse_search (GtkSourceVimState *self)
+{
+ GtkSourceVimStatePrivate *priv;
+ GtkSourceVimState *root;
+
+ g_return_val_if_fail (GTK_SOURCE_IS_VIM_STATE (self), FALSE);
+
+ root = gtk_source_vim_state_get_root (self);
+ priv = gtk_source_vim_state_get_instance_private (root);
+
+ return priv->reverse_search;
+}
+
+void
+gtk_source_vim_state_set_reverse_search (GtkSourceVimState *self,
+ gboolean reverse_search)
+{
+ GtkSourceVimStatePrivate *priv;
+ GtkSourceVimState *root;
+
+ g_return_if_fail (GTK_SOURCE_IS_VIM_STATE (self));
+
+ root = gtk_source_vim_state_get_root (self);
+ priv = gtk_source_vim_state_get_instance_private (root);
+
+ priv->reverse_search = !!reverse_search;
+}
diff --git a/gtksourceview/vim/gtk-source-vim-state.h b/gtksourceview/vim/gtk-source-vim-state.h
index 1ff0b065..13efe80a 100644
--- a/gtksourceview/vim/gtk-source-vim-state.h
+++ b/gtksourceview/vim/gtk-source-vim-state.h
@@ -121,6 +121,9 @@ void gtk_source_vim_state_select_linewise (GtkSourceVim
void gtk_source_vim_state_get_search (GtkSourceVimState *self,
GtkSourceSearchSettings **settings,
GtkSourceSearchContext **context);
+gboolean gtk_source_vim_state_get_reverse_search (GtkSourceVimState *self);
+void gtk_source_vim_state_set_reverse_search (GtkSourceVimState *self,
+ gboolean
reverse_search);
void gtk_source_vim_state_keyval_to_string (guint keyval,
GdkModifierType mods,
char string[16]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]