Skip to content

Detect clicking on a line number #1173

Discussion options

You must be logged in to vote

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 use vscode.window.onDidChangeTextEditorSelection event, looking at the event property to be TextEditorSelectionChangeKind.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 and Copy vscode.dev link. entries, you must contribute to the "editor/lineNumber/context" entry in the "menus" contribution point.

Hope this helps

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ArturoDent
Comment options

Answer selected by ArturoDent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants