Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get row and column number from mouse coordinates

I am using Ace for my in browser text editor.

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

From clientX clientY coordinates i need actual row and column number on the editor.

Looking at Ace api but cant find anything related.

Do you know any way i can achieve this?

Thanks

like image 255
mikbal Avatar asked Oct 10 '12 22:10

mikbal


1 Answers

Found it.

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

found it looking inside event object in chrome debugger.

like image 109
mikbal Avatar answered Nov 10 '22 11:11

mikbal