[gtksourceview/wip/chergert/vim] walk up chain to get view
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/vim] walk up chain to get view
- Date: Mon, 1 Nov 2021 16:11:47 +0000 (UTC)
commit 690e98486543f2d209f0f74b2132c2b264bbd0fa
Author: Christian Hergert <chergert redhat com>
Date: Mon Nov 1 09:11:38 2021 -0700
walk up chain to get view
this can happen with some motion/visual/delete combinations and replay
gtksourceview/vim/gtk-source-vim-state.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gtksourceview/vim/gtk-source-vim-state.c b/gtksourceview/vim/gtk-source-vim-state.c
index aa17f49b..86067bc3 100644
--- a/gtksourceview/vim/gtk-source-vim-state.c
+++ b/gtksourceview/vim/gtk-source-vim-state.c
@@ -539,7 +539,7 @@ gtk_source_vim_state_select (GtkSourceVimState *self,
const GtkTextIter *insert,
const GtkTextIter *selection)
{
- GtkSourceVimStatePrivate *priv = gtk_source_vim_state_get_instance_private (self);
+ GtkSourceView *view;
GtkTextBuffer *buffer;
g_return_if_fail (GTK_SOURCE_IS_VIM_STATE (self));
@@ -548,7 +548,12 @@ gtk_source_vim_state_select (GtkSourceVimState *self,
if (selection == NULL)
selection = insert;
- buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->view));
+ view = gtk_source_vim_state_get_view (self);
+ g_return_if_fail (GTK_SOURCE_IS_VIEW (view));
+
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
+ g_return_if_fail (GTK_SOURCE_IS_BUFFER (buffer));
+
gtk_text_buffer_select_range (buffer, insert, selection);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]