From c71714608583203fe07b8b5e866a1defba2c3d2a Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 8 Oct 2010 16:20:40 +0200 Subject: vim_mode: $map->{char} is always in <> notation. Not control characters. --- vim-mode/vim_mode.pl | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'vim-mode/vim_mode.pl') diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 4a58273..aacaed5 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -1597,15 +1597,14 @@ sub ex_map { foreach my $key (sort keys %$maps) { my $map = $maps->{$key}; my $cmd = $map->{cmd}; - if (defined $map->{char}) { - my $char = _parse_mapping_reverse($map->{char}); - next if $char eq $cmd->{char}; # skip default mappings + if (defined $cmd) { + next if $map->{char} eq $cmd->{char}; # skip default mappings - my $cmdc = _parse_mapping_reverse($cmd->{char}); + my $cmdc = $cmd->{char}; if ($cmd->{type} == C_EX) { $cmdc = ":$cmdc"; } - $active_window->print(sprintf "%-15s %s", $char, $cmdc); + $active_window->print(sprintf "%-15s %s", $map->{char}, $cmdc); } } } else { @@ -2370,7 +2369,10 @@ sub add_map { while (length $tmp > 1) { my $map = substr $tmp, -1, 1, ''; if (not exists $maps->{$tmp}) { - $maps->{$tmp} = { cmd => undef, maps => {} }; + $maps->{$tmp} = { char => _parse_mapping_reverse($tmp), + cmd => undef, + maps => {} + }; } if (not exists $maps->{$tmp}->{maps}->{$tmp . $map}) { $maps->{$tmp}->{maps}->{$tmp . $map} = undef; @@ -2378,14 +2380,13 @@ sub add_map { } if (not exists $maps->{$keys}) { - $maps->{$keys} = { char => $keys, - cmd => $command, + $maps->{$keys} = { char => undef, + cmd => undef, maps => {} }; - } else { - $maps->{$keys}->{char} = $keys; - $maps->{$keys}->{cmd} = $command; } + $maps->{$keys}->{char} = _parse_mapping_reverse($keys); + $maps->{$keys}->{cmd} = $command; } -- cgit v1.2.3