summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editors/vi.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 4e1a239..e3e0f4b 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -3513,16 +3513,15 @@ static void do_cmd(int c)
} while (--cmdcnt > 0);
break;
case '{': // {- move backward paragraph
- q = char_search(dot, "\n\n", ((unsigned)BACK << 1) | FULL);
- if (q != NULL) { // found blank line
- dot = next_line(q); // move to next blank line
- }
- break;
case '}': // }- move forward paragraph
- q = char_search(dot, "\n\n", (FORWARD << 1) | FULL);
- if (q != NULL) { // found blank line
- dot = next_line(q); // move to next blank line
- }
+ do {
+ q = char_search(dot, "\n\n", c == '{' ?
+ ((unsigned)BACK << 1) | FULL :
+ (FORWARD << 1) | FULL);
+ if (q != NULL) { // found blank line
+ dot = next_line(q); // move to next blank line
+ }
+ } while (--cmdcnt > 0);
break;
#endif /* FEATURE_VI_SEARCH */
case '0': // 0- goto beginning of line