* added highlightgutterline setting
This commit is contained in:
parent
b448a1ca9c
commit
ba4f7e3765
1 changed files with 30 additions and 7 deletions
|
|
@ -325,6 +325,7 @@ var Editor = function(renderer, session) {
|
||||||
|
|
||||||
this.$highlightBrackets();
|
this.$highlightBrackets();
|
||||||
this.$updateHighlightActiveLine();
|
this.$updateHighlightActiveLine();
|
||||||
|
this.$updateHighlightGutterLine();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$updateHighlightActiveLine = function() {
|
this.$updateHighlightActiveLine = function() {
|
||||||
|
|
@ -332,13 +333,10 @@ var Editor = function(renderer, session) {
|
||||||
|
|
||||||
if (session.$highlightLineMarker)
|
if (session.$highlightLineMarker)
|
||||||
session.removeMarker(session.$highlightLineMarker);
|
session.removeMarker(session.$highlightLineMarker);
|
||||||
if (typeof this.$lastrow == "number")
|
|
||||||
this.renderer.removeGutterDecoration(this.$lastrow, "ace_gutter_active_line");
|
|
||||||
|
|
||||||
session.$highlightLineMarker = null;
|
session.$highlightLineMarker = null;
|
||||||
this.$lastrow = null;
|
|
||||||
|
|
||||||
if (this.getHighlightActiveLine()) {
|
if (this.$highlightActiveLine) {
|
||||||
var cursor = this.getCursorPosition(),
|
var cursor = this.getCursorPosition(),
|
||||||
foldLine = this.session.getFoldLine(cursor.row);
|
foldLine = this.session.getFoldLine(cursor.row);
|
||||||
|
|
||||||
|
|
@ -351,11 +349,20 @@ var Editor = function(renderer, session) {
|
||||||
}
|
}
|
||||||
session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "background");
|
session.$highlightLineMarker = session.addMarker(range, "ace_active_line", "background");
|
||||||
}
|
}
|
||||||
|
|
||||||
this.renderer.addGutterDecoration(this.$lastrow = cursor.row, "ace_gutter_active_line");
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.$updateHighlightGutterLine = function(){
|
||||||
|
if (typeof this.$lastrow == "number")
|
||||||
|
this.renderer.removeGutterDecoration(this.$lastrow, "ace_gutter_active_line");
|
||||||
|
|
||||||
|
this.$lastrow = null;
|
||||||
|
|
||||||
|
if (this.$highlightGutterLine)
|
||||||
|
this.renderer.addGutterDecoration(
|
||||||
|
this.$lastrow = this.getCursorPosition().row, "ace_gutter_active_line");
|
||||||
|
}
|
||||||
|
|
||||||
this.onSelectionChange = function(e) {
|
this.onSelectionChange = function(e) {
|
||||||
var session = this.getSession();
|
var session = this.getSession();
|
||||||
|
|
||||||
|
|
@ -370,6 +377,7 @@ var Editor = function(renderer, session) {
|
||||||
session.$selectionMarker = session.addMarker(range, "ace_selection", style);
|
session.$selectionMarker = session.addMarker(range, "ace_selection", style);
|
||||||
} else {
|
} else {
|
||||||
this.$updateHighlightActiveLine();
|
this.$updateHighlightActiveLine();
|
||||||
|
this.$updateHighlightGutterLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.$highlightSelectedWord)
|
if (this.$highlightSelectedWord)
|
||||||
|
|
@ -408,6 +416,7 @@ var Editor = function(renderer, session) {
|
||||||
// Update the active line marker as due to folding changes the current
|
// Update the active line marker as due to folding changes the current
|
||||||
// line range on the screen might have changed.
|
// line range on the screen might have changed.
|
||||||
this.$updateHighlightActiveLine();
|
this.$updateHighlightActiveLine();
|
||||||
|
this.$updateHighlightGutterLine();
|
||||||
// TODO: This might be too much updating. Okay for now.
|
// TODO: This might be too much updating. Okay for now.
|
||||||
this.renderer.updateFull();
|
this.renderer.updateFull();
|
||||||
};
|
};
|
||||||
|
|
@ -573,7 +582,8 @@ var Editor = function(renderer, session) {
|
||||||
|
|
||||||
this.$highlightActiveLine = true;
|
this.$highlightActiveLine = true;
|
||||||
this.setHighlightActiveLine = function(shouldHighlight) {
|
this.setHighlightActiveLine = function(shouldHighlight) {
|
||||||
if (this.$highlightActiveLine == shouldHighlight) return;
|
if (this.$highlightActiveLine == shouldHighlight)
|
||||||
|
return;
|
||||||
|
|
||||||
this.$highlightActiveLine = shouldHighlight;
|
this.$highlightActiveLine = shouldHighlight;
|
||||||
this.$updateHighlightActiveLine();
|
this.$updateHighlightActiveLine();
|
||||||
|
|
@ -583,6 +593,19 @@ var Editor = function(renderer, session) {
|
||||||
return this.$highlightActiveLine;
|
return this.$highlightActiveLine;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.$highlightGutterLine = true;
|
||||||
|
this.setHighlightGutterLine = function(shouldHighlightGutterLine) {
|
||||||
|
if (this.$highlightGutterLine == shouldHighlightGutterLine)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.$highlightGutterLine = shouldHighlightGutterLine;
|
||||||
|
this.$updateHighlightGutterLine();
|
||||||
|
};
|
||||||
|
|
||||||
|
this.getHighlightGutterLine = function() {
|
||||||
|
return this.$highlightGutterLine;
|
||||||
|
};
|
||||||
|
|
||||||
this.$highlightSelectedWord = true;
|
this.$highlightSelectedWord = true;
|
||||||
this.setHighlightSelectedWord = function(shouldHighlight) {
|
this.setHighlightSelectedWord = function(shouldHighlight) {
|
||||||
if (this.$highlightSelectedWord == shouldHighlight)
|
if (this.$highlightSelectedWord == shouldHighlight)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue