← Commit list

d08206dce

Ron Yorston
Ron Yorston
2018-12-03
SUCCESS Duration: 170s

Subject

vi: correctly detect when a deletion empties the buffer

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+1 -1
@@ -2364,7 +2364,7 @@ static void undo_push(char *src, unsigned int length, uint8_t u_type) // Add to
// Allocate a new undo object
if (u_type == UNDO_DEL || u_type == UNDO_DEL_CHAIN) {
// For UNDO_DEL objects, save deleted text
- if ((src + length) == end)
+ if ((text + length) == end)
length--;
// If this deletion empties text[], strip the newline. When the buffer becomes
// zero-length, a newline is added back, which requires this to compensate.