From e92125633b277885c957dfa998a14a51580adade Mon Sep 17 00:00:00 2001 From: Javier Godoy <11554739+javier-godoy@users.noreply.github.com> Date: Tue, 27 Dec 2022 16:03:20 -0300 Subject: [PATCH] refactor: replace ISelectionPosition with IBufferRange See xtermjs/xterm.js#3952 --- .../META-INF/frontend/fc-xterm/xterm-selection-mixin.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/resources/META-INF/frontend/fc-xterm/xterm-selection-mixin.ts b/src/main/resources/META-INF/frontend/fc-xterm/xterm-selection-mixin.ts index 86ba033..9917b92 100644 --- a/src/main/resources/META-INF/frontend/fc-xterm/xterm-selection-mixin.ts +++ b/src/main/resources/META-INF/frontend/fc-xterm/xterm-selection-mixin.ts @@ -97,12 +97,12 @@ class SelectionAddon extends TerminalAddon { let buffer = (terminal.buffer.active as any)._buffer; let range = buffer.getWrappedRangeForLine(buffer.ybase+buffer.y); - let pos = terminal.getSelectionPosition() || {startRow: buffer.ybase+buffer.y, startColumn: buffer.x}; + let pos = terminal.getSelectionPosition() || {start: {y: buffer.ybase+buffer.y, x: buffer.x}}; resetSelection(); ensureSelection(); let dx = range.first * terminal.cols - this.__selectionAnchor!; - if (pos.startRow != range.first || pos.startColumn != promptLength()) { + if (pos.start.y != range.first || pos.start.x != promptLength()) { dx+= promptLength(); } @@ -126,8 +126,7 @@ class SelectionAddon extends TerminalAddon { let buffer = (terminal.buffer.active as any)._buffer; let range = buffer.getWrappedRangeForLine(buffer.ybase+buffer.y); let pos = terminal.getSelectionPosition(); - if (pos && pos.startRow>=range.first && pos.endRow<=range.last) { - //let selectionStart = pos.startRow * terminal.cols + pos.startColumn; + if (pos && pos.start.y>=range.first && pos.end.y<=range.last) { if (!this.__selectionRight) { //cursor backward wrapped terminal.write("\x1b[<" + this.__selectionLength + "L");