File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
src/vs/workbench/contrib/codeEditor/browser Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -99,15 +99,15 @@ export class EditorLineNumberContextMenu extends Disposable implements IEditorCo
9999 // set the selection to the clicked line number
100100 if ( e . target . type === MouseTargetType . GUTTER_LINE_NUMBERS ) {
101101 const currentSelections = this . editor . getSelections ( ) ;
102- const containsSelection = currentSelections ?. some ( selection => selection . containsPosition ( { lineNumber, column : 1 } ) ) ;
102+ const lineRange = {
103+ startLineNumber : lineNumber ,
104+ endLineNumber : lineNumber ,
105+ startColumn : 1 ,
106+ endColumn : model . getLineLength ( lineNumber ) + 1
107+ } ;
108+ const containsSelection = currentSelections ?. some ( selection => ! selection . isEmpty ( ) && selection . intersectRanges ( lineRange ) !== null ) ;
103109 if ( ! containsSelection ) {
104- const selection = {
105- startLineNumber : lineNumber ,
106- endLineNumber : lineNumber ,
107- startColumn : 1 ,
108- endColumn : model . getLineLength ( lineNumber ) + 1
109- } ;
110- this . editor . setSelection ( selection , TextEditorSelectionSource . PROGRAMMATIC ) ;
110+ this . editor . setSelection ( lineRange , TextEditorSelectionSource . PROGRAMMATIC ) ;
111111 }
112112 }
113113
You can’t perform that action at this time.
0 commit comments