aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Feist <shabble@cowu.be>2010-09-25 23:10:52 +0000
committerTom Feist <shabble@cowu.be>2010-09-25 23:10:52 +0000
commit316b76e7c36829f8c4e4fb9e59485ba39399072e (patch)
tree83e4fa21fd244304660b66baca2df7b88863ca94
parentchanges suggested by ahf to guide.pod - be less bossy (diff)
parentvim_mode: Enter in command mode sends current line. (diff)
downloadirssi-scripts-316b76e7c36829f8c4e4fb9e59485ba39399072e.tar.gz
irssi-scripts-316b76e7c36829f8c4e4fb9e59485ba39399072e.zip
Merge branch 'dev' of github.com:shabble/shab-irssi-scripts
-rw-r--r--vim-mode/vim_mode.pl16
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);
}
}