Listening for click event on gutter row


Similar to Event to listen for code folding/unfolding I want to know the row number when the gutter is clicked on. Looking at the Gutter docs/source there doesn’t appear to the ability to register a listener for Gutter events, however I notice that when you click on a row number in the gutter, the row highlights so there must be some event to listen for.


You can probably listen to the gutter events with a library like dom-listener (so that you don’t need to get a reference to the gutter) and then you can use the screenPositionForPixelPosition method of the text editor element to get the row at mouse position:

As for the listener on the gutter that selects the line on a clik, you can find it here: