aboutsummaryrefslogtreecommitdiffstats
path: root/vim-mode
diff options
context:
space:
mode:
authorSimon Ruderich <simon@ruderich.org>2010-10-08 16:31:26 +0000
committerSimon Ruderich <simon@ruderich.org>2010-10-08 16:31:26 +0000
commit65938fc59dd2c41751f6a05e8c823cf52b5f3750 (patch)
tree3f85aa24540e58fb907058e0e5a038d9a6886f08 /vim-mode
parentvim_mode: Add <C-E> and <C-Y>. (diff)
downloadirssi-scripts-65938fc59dd2c41751f6a05e8c823cf52b5f3750.tar.gz
irssi-scripts-65938fc59dd2c41751f6a05e8c823cf52b5f3750.zip
vim_mode: Backspacing over : in ex-mode exists it.
Suggested by estragib.
Diffstat (limited to 'vim-mode')
-rw-r--r--vim-mode/vim_mode.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index 88c4bfb..34460f8 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -2196,8 +2196,13 @@ sub handle_command_ex {
# DEL key - remove last character
if ($key == 127) {
print "Delete" if DEBUG;
- pop @ex_buf;
- _set_prompt(':' . join '', @ex_buf);
+ if (scalar @ex_buf > 0) {
+ pop @ex_buf;
+ _set_prompt(':' . join '', @ex_buf);
+ # Backspacing over : exists ex-mode.
+ } else {
+ _update_mode(M_CMD);
+ }
# Return key - execute command
} elsif ($key == 10) {