[gtksourceview/wip/chergert/vim] overwrite character when in replace mode
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/vim] overwrite character when in replace mode
- Date: Fri, 22 Oct 2021 18:29:39 +0000 (UTC)
commit b8b8a9081ad90e55778e41ef88ab48d0dea123ae
Author: Christian Hergert <chergert redhat com>
Date: Fri Oct 22 11:01:23 2021 -0700
overwrite character when in replace mode
still need to fix how we remove overwrite mode for insert mode while
retaining the block cursor.
gtksourceview/vim/gtk-source-vim-insert-literal.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
---
diff --git a/gtksourceview/vim/gtk-source-vim-insert-literal.c
b/gtksourceview/vim/gtk-source-vim-insert-literal.c
index 893c80eb..87ff40af 100644
--- a/gtksourceview/vim/gtk-source-vim-insert-literal.c
+++ b/gtksourceview/vim/gtk-source-vim-insert-literal.c
@@ -46,9 +46,22 @@ do_literal (GtkSourceVimInsertLiteral *self,
if (string[0] != 0)
{
GtkSourceBuffer *buffer;
+ GtkSourceView *view;
GtkTextIter insert;
+ view = gtk_source_vim_state_get_view (GTK_SOURCE_VIM_STATE (self));
buffer = gtk_source_vim_state_get_buffer (GTK_SOURCE_VIM_STATE (self), &insert, NULL);
+
+ if (gtk_text_view_get_overwrite (GTK_TEXT_VIEW (view)))
+ {
+ GtkTextIter end = insert;
+
+ if (gtk_text_iter_forward_char (&end))
+ {
+ gtk_text_buffer_delete (GTK_TEXT_BUFFER (buffer), &insert, &end);
+ }
+ }
+
gtk_text_buffer_insert (GTK_TEXT_BUFFER (buffer), &insert, string, -1);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]