[gtksourceview/wip/chergert/vim: 193/293] walk up chain to get view
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/vim: 193/293] walk up chain to get view
- Date: Fri, 5 Nov 2021 04:23:04 +0000 (UTC)
commit dc0ce1d266401ff4b6a5fc564f639d5543761b7c
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]