fixed cursor destruction on getLineNumberAtCursor() method to ZString.

This commit is contained in:
Brad Arant 2024-11-26 09:48:56 -08:00
parent 52d3985ffa
commit ab4da04de6

View File

@ -576,9 +576,10 @@ namespace coreutils {
} }
int ZString::getLineNumberAtCursor() { int ZString::getLineNumberAtCursor() {
char *temp = cursor;
int line = 1; int line = 1;
while(cursor != data) while(temp != data)
if(*cursor-- == '\n') if(*temp-- == '\n')
++line; ++line;
return line; return line;
} }