diff options
author | Tom Feist <shabble@cowu.be> | 2010-09-25 23:10:52 +0000 |
---|---|---|
committer | Tom Feist <shabble@cowu.be> | 2010-09-25 23:10:52 +0000 |
commit | 316b76e7c36829f8c4e4fb9e59485ba39399072e (patch) | |
tree | 83e4fa21fd244304660b66baca2df7b88863ca94 /vim-mode/vim_mode.pl | |
parent | changes suggested by ahf to guide.pod - be less bossy (diff) | |
parent | vim_mode: Enter in command mode sends current line. (diff) | |
download | irssi-scripts-316b76e7c36829f8c4e4fb9e59485ba39399072e.tar.gz irssi-scripts-316b76e7c36829f8c4e4fb9e59485ba39399072e.zip |
Merge branch 'dev' of github.com:shabble/shab-irssi-scripts
Diffstat (limited to 'vim-mode/vim_mode.pl')
-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); } } |