From 8f2bd0ac21b64271a2ac9eb934ca4cc5dfe956f7 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 2 Oct 2010 17:27:57 +0200 Subject: vim_mode: Fix history with /set vim_mode_utf8 on. --- vim-mode/vim_mode.pl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'vim-mode') diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 2adcdc9..117d639 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -529,7 +529,12 @@ sub cmd_movement_j { _input_pos($history_pos); $history_index = $#history + 1; } elsif ($history_index >= 0) { - _input($history[$history_index]); + my $history = $history[$history_index]; + # History is not in UTF-8! + if ($utf8) { + $history = decode_utf8($history); + } + _input($history); _input_pos(0); } return; @@ -556,7 +561,12 @@ sub cmd_movement_k { } print "History Index: $history_index" if DEBUG; if ($history_index >= 0) { - _input($history[$history_index]); + my $history = $history[$history_index]; + # History is not in UTF-8! + if ($utf8) { + $history = decode_utf8($history); + } + _input($history); _input_pos(0); } return; -- cgit v1.2.3