Skip to content

Commit

Permalink
Fix a bug when copying lines of wrapped text
Browse files Browse the repository at this point in the history
  • Loading branch information
sedwards2009 committed Jul 21, 2024
1 parent 2645cce commit add9dc9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions main/src/terminal/TerminalBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -923,14 +923,22 @@ export class TerminalBlock implements Block {
lineText.push(line.getString(start.x, end.x - start.x).trimEnd());
} else {
// Top row of the selection.
lineText.push(line.getString(start.x, line.width-start.x).trimEnd());
let text = line.getString(start.x, line.width-start.x);
if ( ! line.isWrapped) {
text = text.trimEnd();
}
lineText.push(text);
}
} else {
if ( ! isLastLineWrapped) {
lineText.push("\n");
}
if (i !== end.y) {
lineText.push(line.getString(0, line.width).trimEnd());
let text = line.getString(0, line.width);
if ( ! line.isWrapped) {
text = text.trimEnd();
}
lineText.push(text);
} else {
// The last row of a multi-row selection.
lineText.push(line.getString(0, end.x));
Expand Down

0 comments on commit add9dc9

Please sign in to comment.