added moveBackToLineStart() method on ZString.

This commit is contained in:
Brad Arant committed 2024-11-26 10:33:31 -08:00
1 parent ab4da04de6
commit 2de5693e87
2 files changed
+15

No files matched your search

+8
View File
@@ -584,5 +584,13 @@ namespace coreutils {
return line; return line;
} }
void ZString::moveBackToLineStart() {
while(cursor != data) {
if(*cursor == '\n')
break;
cursor--;
}
return;
}
} }
+7
View File
@@ -446,6 +446,13 @@ namespace coreutils {
int getLineNumberAtCursor(); int getLineNumberAtCursor();
///
/// Move the cursor to the beginning of a line or to the beginning of
/// the ZString.
///
void moveBackToLineStart();
protected: protected:
char *data; char *data;
char *cursor; char *cursor;