added moveBackToLineStart() method on ZString.
This commit is contained in:
parent
ab4da04de6
commit
2de5693e87
12
ZString.cpp
12
ZString.cpp
@ -583,6 +583,14 @@ namespace coreutils {
|
|||||||
++line;
|
++line;
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ZString::moveBackToLineStart() {
|
||||||
|
while(cursor != data) {
|
||||||
|
if(*cursor == '\n')
|
||||||
|
break;
|
||||||
|
cursor--;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -445,7 +445,14 @@ 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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user