mirror of
https://github.com/vishalxl/nostr_console.git
synced 2025-04-26 00:15:23 +02:00
improved content right shift logic
This commit is contained in:
parent
1ac279d6d7
commit
701e357d87
@ -31,13 +31,14 @@ String rightShiftContent(String s, int numSpaces) {
|
|||||||
|
|
||||||
for(int i = 0; i < s.length; i++) {
|
for(int i = 0; i < s.length; i++) {
|
||||||
if( s[i] == '\n') {
|
if( s[i] == '\n') {
|
||||||
newlineCounter = 0;
|
|
||||||
newString += "\n";
|
newString += "\n";
|
||||||
newString += spacesString;
|
newString += spacesString;
|
||||||
|
newlineCounter = 0;
|
||||||
} else {
|
} else {
|
||||||
if( newlineCounter == (screenWidth - numSpaces)) {
|
if( newlineCounter >= (screenWidth - numSpaces)) {
|
||||||
newString += "\n";
|
newString += "\n";
|
||||||
newString += spacesString;
|
newString += spacesString;
|
||||||
|
newlineCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
newString += s[i];
|
newString += s[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user