[gtksourceview] vim: truncate uncommitted command text
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] vim: truncate uncommitted command text
- Date: Tue, 7 Dec 2021 08:20:41 +0000 (UTC)
commit 805d62e99ceb2eefc2655b53e4d8e0d61cc4715f
Author: Christian Hergert <chergert redhat com>
Date: Tue Dec 7 00:20:31 2021 -0800
vim: truncate uncommitted command text
gtksourceview/vim/gtksourcevimnormal.c | 6 ++++++
1 file changed, 6 insertions(+)
---
diff --git a/gtksourceview/vim/gtksourcevimnormal.c b/gtksourceview/vim/gtksourcevimnormal.c
index 632b4fd6..4d9a6986 100644
--- a/gtksourceview/vim/gtksourcevimnormal.c
+++ b/gtksourceview/vim/gtksourcevimnormal.c
@@ -1314,6 +1314,12 @@ key_handler_initial (GtkSourceVimNormal *self,
*/
if ((mods & (GDK_CONTROL_MASK | GDK_SUPER_MASK | GDK_ALT_MASK)) != 0 || string[0] == 0)
{
+ /* Ignore this from the command_text */
+ if (strlen (string) <= self->command_text->len)
+ {
+ g_string_truncate (self->command_text, self->command_text->len - strlen
(string));
+ }
+
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]