Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highlight rows that have been changed

Tags:

ace-editor

I have ace editor integrated in my site. I have some code there, and i want to highlight changes in some rows.

Found out that

var range = new Range(rowStart, columnStart, rowEnd, columnEnd);
var marker = editor.getSession().addMarker(range,"ace_active_line","background");

supposed to highlight rows, but i get illigal constructor error on the creation of Range object. Any ideas ?

Is there a way to add yellow background to specific lines ?

Thanks

like image 710
amitdar Avatar asked Dec 27 '22 04:12

amitdar


1 Answers

The problem is here that Range points to the browsers native range function and not to the Ace one. So you're probably not importing it. Try doing something like:

// taken from kitchen-sink.js
var Range = require("./range").Range;
like image 181
Jan Jongboom Avatar answered Jan 19 '23 01:01

Jan Jongboom