diff options
| author | Tom Feist <shabble@metavore.org> | 2010-09-27 23:08:45 +0000 | 
|---|---|---|
| committer | Tom Feist <shabble@metavore.org> | 2010-09-27 23:08:45 +0000 | 
| commit | 98b1b6bac606f3a2d52080a4d9490351860cec51 (patch) | |
| tree | 4fc640b47121013ee81e5cff738f3707a4126063 | |
| parent | changed commit_line to only do internal housekeeping - enter now submits the (diff) | |
| download | irssi-scripts-98b1b6bac606f3a2d52080a4d9490351860cec51.tar.gz irssi-scripts-98b1b6bac606f3a2d52080a4d9490351860cec51.zip  | |
fixed enter key not working in cmd mode, also added pass-thru for meta-keys in
cmd mode
| -rw-r--r-- | vim-mode/vim_mode.pl | 28 | 
1 files changed, 16 insertions, 12 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 31b8d88..44abc99 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -817,17 +817,18 @@ sub handle_input_buffer {      } else {          # we need to identify what we got, and either replay it          # or pass it off to the command handler. -        if ($mode == M_CMD) { -            # command -            my $key_str = join '', map { chr } @input_buf; -            if ($key_str =~ m/^\e\[([ABCD])/) { -                print "Arrow key: $1" if DEBUG; -            } else { -                print "Dunno what that is." if DEBUG; -            } -        } else { -            _emulate_keystrokes(@input_buf); -        } +        # if ($mode == M_CMD) { +        #     # command +        #     my $key_str = join '', map { chr } @input_buf; +        #     if ($key_str =~ m/^\e\[([ABCD])/) { +        #         print "Arrow key: $1" if DEBUG; +        #     } else { +        #         print "Dunno what that is." if DEBUG; +        #     } +        # } else { +        #     _emulate_keystrokes(@input_buf); +        # } +        _emulate_keystrokes(@input_buf);      }      @input_buf = (); @@ -863,6 +864,8 @@ sub handle_numeric_prefix {  sub handle_command {      my ($key) = @_; +    my $should_stop = 1; +      if ($mode == M_EX) {          # DEL key - remove last character          if ($key == 127) { @@ -1025,13 +1028,14 @@ sub handle_command {          # Enter key sends the current input line in command mode as well.          } elsif ($key == 10) { +            $should_stop = 0;              _commit_line();          }          Irssi::statusbar_items_redraw("vim_mode");      } -    _stop(); +    _stop() if $should_stop;  }  sub vim_mode_init {  | 
