mirror of
https://github.com/embarklabs/neo-blessed.git
synced 2025-01-10 19:16:20 +00:00
Fixes last character cropping bug
This commit is contained in:
parent
47ead5ea93
commit
832f47d2c5
@ -2229,6 +2229,7 @@ main:
|
||||
if (++total === width) {
|
||||
// If we're not wrapping the text, we have to finish up the rest of
|
||||
// the control sequences before cutting off the line.
|
||||
i++;
|
||||
if (!wrap) {
|
||||
rest = line.substring(i).match(/\x1b\[[^m]*m/g);
|
||||
rest = rest ? rest.join('') : '';
|
||||
@ -2238,12 +2239,10 @@ main:
|
||||
continue main;
|
||||
}
|
||||
// Try to find a space to break on.
|
||||
if (line[i] !== ' ') {
|
||||
if (i !== line.length) {
|
||||
j = i;
|
||||
while (j > i - 10 && j > 0 && line[j] !== ' ') j--;
|
||||
while (j > i - 10 && j > 0 && line[--j] !== ' ');
|
||||
if (line[j] === ' ') i = j + 1;
|
||||
} else {
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user