diff --git a/src/app/line/linesview.tsx b/src/app/line/linesview.tsx index 9b095eb3..83e41159 100644 --- a/src/app/line/linesview.tsx +++ b/src/app/line/linesview.tsx @@ -28,6 +28,8 @@ type ScreenInterface = { setAnchorFields(anchorLine: number, anchorOffset: number, reason: string): void; getSelectedLine(): number; getAnchor(): { anchorLine: number; anchorOffset: number }; + isLineIdInSidebar(lineId: string): boolean; + getLineByNum(lineNum: number): T.LineType; }; // ; @@ -298,6 +300,10 @@ class LinesView extends React.Component< if (newLine == 0) { return; } + let line = screen.getLineByNum(newLine); + if (line == null || screen.isLineIdInSidebar(line.lineid)) { + return; + } let lidx = this.findClosestLineIndex(newLine); this.setLineVisible(newLine, true); // console.log("update selected line", this.lastSelectedLine, "=>", newLine, sprintf("anchor=%d:%d", screen.anchorLine, screen.anchorOffset));