Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a programmatic way to hide the cursor in Ace Editor?

Tags:

ace-editor

I've set the editor to read only and it is read only but it is showing a cursor. I'd like to programmatically hide the cursor (not through a style unless programmatically).

enter image description here

like image 451
1.21 gigawatts Avatar asked Sep 27 '15 08:09

1.21 gigawatts


1 Answers

Here's what suggested answers do, for visual comparison:

Here's what it looked like before:

enter image description here

adding:

editor.setOptions({readOnly: true, highlightActiveLine: false, highlightGutterLine: false});

as suggested by "a user", removes the gutter and line highlight, but the cursor is still there:

enter image description here

then adding the line:

editor.renderer.$cursorLayer.element.style.display = "none"

as suggested by "daronwolff" removes the cursor:

enter image description here

like image 154
Catherine Holloway Avatar answered Sep 28 '22 11:09

Catherine Holloway