|
|
@@ -11,6 +11,7 @@ class ReflowStrategyWider extends ReflowStrategy {
|
|
|
void reflow(int newCols, int newRows, int oldCols, int oldRows) {
|
|
|
for (var i = 0; i < buffer.lines.length; i++) {
|
|
|
final line = buffer.lines[i];
|
|
|
+ line.ensure(newCols);
|
|
|
for (var offset = 1; i + offset < buffer.lines.length; offset++) {
|
|
|
final nextLine = buffer.lines[i + offset];
|
|
|
if (!nextLine.isWrapped) {
|
|
|
@@ -38,11 +39,12 @@ class ReflowStrategyWider extends ReflowStrategy {
|
|
|
}
|
|
|
|
|
|
// when we are about to copy a double width character
|
|
|
- // to the end of the line then we can include the 0 width placeholder
|
|
|
- // after it
|
|
|
- if (nextLine.cellGetWidth(moveCount - 1) == 2 &&
|
|
|
- nextLine.cellGetContent(moveCount) == 0) {
|
|
|
- moveCount += 1;
|
|
|
+ // to the end of the line then we just ignore it as the target width
|
|
|
+ // would be too much
|
|
|
+ if (moveCount >= 2 &&
|
|
|
+ nextLine.cellGetWidth(moveCount - 1) == 2 &&
|
|
|
+ nextLine.cellGetContent(moveCount - 2) == 0) {
|
|
|
+ moveCount -= 1;
|
|
|
}
|
|
|
line.copyCellsFrom(nextLine, 0, copyDestIndex, moveCount);
|
|
|
if (moveCount >= nextLineLength) {
|