From 389c137df9327075ae9e11cab33ae4c6649ab827 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 25 May 2013 12:36:02 +0300 Subject: [PATCH] Allow repeat prefix for move paragraph forward/backward command --- virus.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/virus.c b/virus.c index ab411ce..6fa77ae 100644 --- a/virus.c +++ b/virus.c @@ -1149,16 +1149,20 @@ key_cmd_mode: psbs ("%s", msg); break; case '{': // {- move backward paragraph - q = char_search (dot, (Byte *) "\n\n", BACK, FULL); - if (q != NULL) { // found blank line - dot = next_line (q); // move to next blank line - } + do { + q = char_search(dot, (Byte *) "\n\n", BACK, FULL); + if (q != NULL) { // found blank line + dot = next_line(q); // move to next blank line + } + } while (cmdcnt-- > 1); break; case '}': // }- move forward paragraph - q = char_search (dot, (Byte *) "\n\n", FORWARD, FULL); - if (q != NULL) { // found blank line - dot = next_line (q); // move to next blank line - } + do { + q = char_search(dot, (Byte *) "\n\n", FORWARD, FULL); + if (q != NULL) { // found blank line + dot = next_line(q); // move to next blank line + } + } while (cmdcnt-- > 1); break; #endif /* BB_FEATURE_VI_SEARCH */ case '0': // 0- goto begining of line -- 2.47.3