From 482c0e7fbd5ea28bd32e968d7c027fdc9fbbbe23 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Sun, 1 Mar 2015 23:49:59 +0100 Subject: introduced the ^G immediate editing command for toggling the undo/redo mode (also replaces ^T) * CTRL+G toggles the behaviour of the rubout (Backspace, ^W, ^U) commands: When the so called immediate editing command modifier is enabled/active, the rubout commands will do the opposite and insert from the rubbed out command line. This command is somewhat similar to Emacs' C-g command. * The CTRL+G command also replaces the ^T immediate editing command for auto-completing filenames in any string argument. Now the TAB key can be used for that purpose after activating the ^G modifier. ^T is a classic TECO command that will be supported sooner or later by SciTECO, so it's good to have it available directly. --- src/cmdline.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/cmdline.h') diff --git a/src/cmdline.h b/src/cmdline.h index 6095cbb..a87e592 100644 --- a/src/cmdline.h +++ b/src/cmdline.h @@ -73,11 +73,13 @@ private: inline void rubout(void) { - undo.pop(--len); - rubout_len++; + if (len) { + undo.pop(--len); + rubout_len++; + } } - void insert(const gchar *src); + void insert(const gchar *src = NULL); inline void insert(gchar key) { -- cgit v1.2.3