← Commit list

4b49422a0

Ron Yorston
Ron Yorston
2019-04-28
SUCCESS Duration: 151s

Subject

vi: fix changes to word at end of line. Closes 11796

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

editors/vi.c+2 -3
@@ -3770,11 +3770,10 @@ static void do_cmd(int c)
if (c1 == 27) { // ESC- user changed mind and wants out
c = c1 = 27; // Escape- do nothing
} else if (strchr("wW", c1)) {
+ ml = 0; // multi-line ranges aren't allowed for words
if (c == 'c') {
// don't include trailing WS as part of word
- while (isblank(*q)) {
- if (q <= text || q[-1] == '\n')
- break;
+ while (isspace(*q) && q > p) {
q--;
}
}