Detect clicking on a line number #1173
-
Is it possible to know when a line number is clicked on? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @ArturoDent , If you mean the line number displayed in the gutter, then no, there is no On the other hand, if you want to know when the line number in the gutter is clicked, to add something to the context menu, similar to the Hope this helps |
Beta Was this translation helpful? Give feedback.
Hi @ArturoDent ,
If you mean the line number displayed in the gutter, then no, there is no
click
event of any sort. If you mean to know when the user clicks anywhere in the text, there is no event either, but you can usevscode.window.onDidChangeTextEditorSelection
event, looking at theevent
property to beTextEditorSelectionChangeKind.Mouse
.On the other hand, if you want to know when the line number in the gutter is clicked, to add something to the context menu, similar to the
Add Breakpoint
andCopy vscode.dev link
. entries, you must contribute to the"editor/lineNumber/context"
entry in the"menus"
contribution point.Hope this helps