diff options
| author | Tom Feist <shabble@metavore.org> | 2010-09-27 22:17:46 +0000 | 
|---|---|---|
| committer | Tom Feist <shabble@metavore.org> | 2010-09-27 22:17:46 +0000 | 
| commit | 3577405263c97302298d91c9c4a8e051d62e5b45 (patch) | |
| tree | 375cff82a9401f18376289bce5e3752a2f52a001 | |
| parent | boldified message in _warn() (diff) | |
| download | irssi-scripts-3577405263c97302298d91c9c4a8e051d62e5b45.tar.gz irssi-scripts-3577405263c97302298d91c9c4a8e051d62e5b45.zip  | |
changed commit_line to only do internal housekeeping - enter now submits the
line to irssi for default handling (signal is not stopped)
| -rw-r--r-- | vim-mode/vim_mode.pl | 31 | 
1 files changed, 4 insertions, 27 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index f33b6c3..31b8d88 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -756,11 +756,9 @@ sub got_key {              _update_mode(M_CMD);              _stop();              return; +          } elsif ($key == 10) { # enter. -            _stop(); -            _commit_line(_input()); -            @undo_buffer = (); -            $undo_index = undef; +            _commit_line();          } elsif ($input_buf_enabled and $imap) {              print "Imap $imap active" if DEBUG; @@ -776,6 +774,7 @@ sub got_key {              _stop();              $imap = undef;              return; +          } elsif (exists $imaps->{chr($key)}) {              print "Imap " . chr($key) . " seen, starting buffer" if DEBUG; @@ -1026,8 +1025,7 @@ sub handle_command {          # Enter key sends the current input line in command mode as well.          } elsif ($key == 10) { -            _stop(); -            _commit_line(_input()); +            _commit_line();          }          Irssi::statusbar_items_redraw("vim_mode"); @@ -1111,29 +1109,8 @@ sub _clear_undo_buffer {  sub _commit_line { -    my ($line) = @_; - -    my $cmdchars = Irssi::settings_get_str('cmdchars'); - -    _input('');      _update_mode(M_INS);      _clear_undo_buffer(); - -    return unless length $line; # ignore empty lines - -    my $server = Irssi::active_server(); -    my $win = Irssi::active_win(); -    my $witem = ref $win ? $win->{active} : undef; - -    my @context; -    push @context, $server if defined $server; -    push @context, $witem  if defined $witem; - -    if ($line =~ /^[\Q$cmdchars\E]/) { -        Irssi::signal_emit 'send command', $line, @context; -    } else { -        Irssi::signal_emit 'send text', $line, @context; -    }  }  sub _input {  | 
