aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Feist <shabble@metavore.org>2011-04-22 02:29:01 +0000
committerTom Feist <shabble@metavore.org>2011-04-22 02:29:01 +0000
commitc3d20ee75292108fdf1d727f01000df687611911 (patch)
tree652719f405d6e967731d30ae9e86df8b8ca9e014
parentMerge branch 'master' into dev (diff)
parentvim-mode: Fix :map displaying <C-H> as mapped to <BS>. (diff)
downloadirssi-scripts-c3d20ee75292108fdf1d727f01000df687611911.tar.gz
irssi-scripts-c3d20ee75292108fdf1d727f01000df687611911.zip
Merge branch 'dev' of github.com:shabble/irssi-scripts into dev
Conflicts: vim-mode/vim_mode.pl
-rw-r--r--vim-mode/vim_mode.pl15
1 files changed, 9 insertions, 6 deletions
diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl
index b0f739f..7c5f957 100644
--- a/vim-mode/vim_mode.pl
+++ b/vim-mode/vim_mode.pl
@@ -656,8 +656,9 @@ my $commands
repeatable => 1 },
# arrow like movement
- h => { char => 'h', func => \&cmd_h, type => C_NORMAL },
- l => { char => 'l', func => \&cmd_l, type => C_NORMAL },
+ h => { char => 'h', func => \&cmd_h, type => C_NORMAL },
+ l => { char => 'l', func => \&cmd_l, type => C_NORMAL },
+ "\x08" => { char => '<BS>', func => \&cmd_h, type => C_NORMAL },
"\x7F" => { char => '<BS>', func => \&cmd_h, type => C_NORMAL },
' ' => { char => '<Space>', func => \&cmd_l, type => C_NORMAL },
# history movement
@@ -2346,6 +2347,8 @@ sub ex_map {
my $cmd = $map->{cmd};
if (defined $cmd) {
next if $map->{char} eq $cmd->{char}; # skip default mappings
+ # FIXME: Hack so <C-H> doesn't show up as mapped to <BS>.
+ next if $map->{char} eq '<C-H>' and $cmd->{char} eq '<BS>';
next if $map->{char} !~ /^\Q$search\E/; # skip non-matches
$active_window->print(sprintf "%-15s %s", $map->{char},
$cmd->{char});
@@ -2741,9 +2744,9 @@ sub got_key {
_stop();
return;
- # Pressing delete resets insert mode repetition.
+ # Pressing delete resets insert mode repetition (8 = BS, 127 = DEL).
# TODO: maybe allow it
- } elsif ($key == 127) {
+ } elsif ($key == 8 || $key == 127) {
@insert_buf = ();
# All other entered characters need to be stored to allow repeat of
# insert mode. Ignore delete and control characters.
@@ -3151,8 +3154,8 @@ sub handle_command_cmd {
sub handle_command_ex {
my ($key) = @_;
- # DEL key - remove last character
- if ($key == 127) {
+ # BS key (8) or DEL key (127) - remove last character.
+ if ($key == 8 || $key == 127) {
print "Delete" if DEBUG;
if (@ex_buf > 0) {
pop @ex_buf;