From 1ad532d8e277e0cfef1784ced89ad4db73ca559c Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sun, 26 Sep 2010 23:10:53 +0200 Subject: vim_mode: Minor code restructure. No functional changes. --- vim-mode/vim_mode.pl | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/vim-mode/vim_mode.pl b/vim-mode/vim_mode.pl index 90391da..91fbc0e 100644 --- a/vim-mode/vim_mode.pl +++ b/vim-mode/vim_mode.pl @@ -718,17 +718,19 @@ sub handle_command { my $skip = 0; - # . repeats the last command. - if ($char eq '.' and !$movement and defined $last->{char}) { - $char = $last->{char}; - # If . is given a count then it replaces original count. - if (not defined $numeric_prefix) { - $numeric_prefix = $last->{numeric_prefix}; + if (!$movement) { + # . repeats the last command. + if ($char eq '.' and defined $last->{char}) { + $char = $last->{char}; + # If . is given a count then it replaces original count. + if (not defined $numeric_prefix) { + $numeric_prefix = $last->{numeric_prefix}; + } + $operator = $last->{operator}; + $movement = $last->{movement}; + } elsif ($char eq '.') { + $skip = 1; } - $operator = $last->{operator}; - $movement = $last->{movement}; - } elsif ($char eq '.') { - $skip = 1; } if ($skip) { -- cgit v1.2.3