Allow repeat prefix for move paragraph forward/backward command

This commit is contained in:
Pasi Kallinen 2013-05-25 12:36:02 +03:00
parent 3c17a9b1bf
commit 389c137df9
1 changed files with 12 additions and 8 deletions

20
virus.c
View File

@ -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