Kaybab
Kaybab

Reputation: 48

Ace editor - Highlight line on mouseover

I would like to highlight the current hovered line in Ace Editor but I can't find any samples of this and API documentation doesn't seem to mention any kind of 'mouseover' or 'mousemove' events.

Please note I'm using Angular 8 and Ace-builds v1.4.5.

Any ideas how to do this?

Upvotes: 0

Views: 975

Answers (1)

a user
a user

Reputation: 24159

one way using only css is to add the following style

.ace_line {
    pointer-events: auto;
}
.ace_line:hover {
    background-color: #a0a4;
}

Another way that allows more customization is to add a mousemove handler and update marker https://github.com/ajaxorg/ace/blob/v1.4.8/lib/ace/autocomplete/popup.js#L108 similar to what popup.js does in ace.

Upvotes: 1

Related Questions