Accumulator for selected text that merges soft-wrapped rows back * into logical lines. push(text, sw) appends a newline before text * only when sw=false (i.e. the row starts a new logical line). Rows * with sw=true are concatenated onto the previous row.
( lines: string[], text: string, sw: boolean | undefined, )
| 748 | * only when sw=false (i.e. the row starts a new logical line). Rows |
| 749 | * with sw=true are concatenated onto the previous row. */ |
| 750 | function joinRows( |
| 751 | lines: string[], |
| 752 | text: string, |
| 753 | sw: boolean | undefined, |
| 754 | ): void { |
| 755 | if (sw && lines.length > 0) { |
| 756 | lines[lines.length - 1] += text |
| 757 | } else { |
| 758 | lines.push(text) |
| 759 | } |
| 760 | } |
| 761 | |
| 762 | /** |
| 763 | * Extract text from the screen buffer within the selection range. |