Get row and column number from mouse coordinates

I use Ace for my text editor in a browser.

editor.on("mousemove", function (e) { // use clientX clientY to get row and column locations }); 

In clientX clientY coordinates, I need the actual row and column number in the editor.

Looking at Ace api but can't find anything related.

Do you know how I can achieve this?

thanks

+4
source share
1 answer

Found.

 editor.on("mousemove", function (e) { var position = e.getDocumentPosition(); }); 

found that he was looking for an event object in the chrome debugger.

+4
source

Source: https://habr.com/ru/post/1439027/


All Articles