diff options
| author | Simon Ruderich <simon@ruderich.org> | 2010-09-25 23:05:28 +0000 | 
|---|---|---|
| committer | Simon Ruderich <simon@ruderich.org> | 2010-09-25 23:05:28 +0000 | 
| commit | 94e23c3a5ec43c70b8ff719d7166e001954e5fdc (patch) | |
| tree | d18db6b473b165bdb27da6cb5d3197c2bb6a01c4 | |
| parent | vim_mode: Add support for t,T,f,T. (diff) | |
| download | irssi-scripts-94e23c3a5ec43c70b8ff719d7166e001954e5fdc.tar.gz irssi-scripts-94e23c3a5ec43c70b8ff719d7166e001954e5fdc.zip | |
vim_mode: Enter in command mode sends current line.
Also switches back to insert mode.
| -rw-r--r-- | vim-mode/vim_mode.pl | 16 | 
1 files changed, 16 insertions, 0 deletions
| diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index e36c41e..e89e4d3 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -504,6 +504,22 @@ sub handle_command {          } elsif ($char eq ':') {              _update_mode(M_EX);              _set_prompt(':'); + +        # Enter key sends the current input line in command mode as well. +        } elsif ($key == 10) { +            my $input = _input(); +            my $cmdchars = Irssi::parse_special('$K'); + +            my $signal; +            if ($input =~ /^[\Q$cmdchars\E]/) { +                $signal = 'send command'; +            } else { +                $signal = 'send text'; +            } +            Irssi::signal_emit $signal, $input, Irssi::active_server(), +                                                Irssi::active_win()->{active}; +            _input(''); +            _update_mode(M_INS);          }      } | 
