From f545afaed0304838881930c6a5944f2c6523322e Mon Sep 17 00:00:00 2001 From: oni-link Date: Sat, 5 Apr 2014 19:28:33 +0200 Subject: vim-patch:7.4.171 Problem: Redo does not set v:count and v:count1. Solution: Use a separate buffer for redo, so that we can set the counts when performing redo. https://code.google.com/p/vim/source/detail?r=beb037a6c2708f539d50840637f70eed0811d93c --- src/normal.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/normal.c') diff --git a/src/normal.c b/src/normal.c index 358dfea075..b3ba4ff77c 100644 --- a/src/normal.c +++ b/src/normal.c @@ -572,8 +572,8 @@ normal_cmd ( /* Set v:count here, when called from main() and not a stuffed * command, so that v:count can be used in an expression mapping - * when there is no count. */ - if (toplevel && stuff_empty()) + * when there is no count. Do set it for redo. */ + if (toplevel && readbuf1_empty()) set_vcount_ca(&ca, &set_prevcount); /* @@ -637,8 +637,8 @@ getcount: ca.count0 = 999999999L; /* Set v:count here, when called from main() and not a stuffed * command, so that v:count can be used in an expression mapping - * right after the count. */ - if (toplevel && stuff_empty()) + * right after the count. Do set it for redo. */ + if (toplevel && readbuf1_empty()) set_vcount_ca(&ca, &set_prevcount); if (ctrl_w) { ++no_mapping; @@ -705,8 +705,9 @@ getcount: /* * Only set v:count when called from main() and not a stuffed command. + * Do set it for redo. */ - if (toplevel && stuff_empty()) + if (toplevel && readbuf1_empty()) set_vcount(ca.count0, ca.count1, set_prevcount); /* -- cgit