* 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.$updateHighlightActiveLine();
|
||||
this.$updateHighlightGutterLine();
|
||||
};
|
||||
|
||||
this.$updateHighlightActiveLine = function() {
|
||||
|
|
@ -332,13 +333,10 @@ var Editor = function(renderer, session) {
|
|||
|
||||
if (session.$highlightLineMarker)
|
||||
session.removeMarker(session.$highlightLineMarker);
|
||||
if (typeof this.$lastrow == "number")
|
||||
this.renderer.removeGutterDecoration(this.$lastrow, "ace_gutter_active_line");
|
||||
|
||||
session.$highlightLineMarker = null;
|
||||
this.$lastrow = null;
|
||||
|
||||
if (this.getHighlightActiveLine()) {
|
||||
if (this.$highlightActiveLine) {
|
||||
var cursor = this.getCursorPosition(),
|
||||
foldLine = this.session.getFoldLine(cursor.row);
|
||||
|
||||
|
|
@ -351,10 +349,19 @@ var Editor = function(renderer, session) {
|
|||
}
|
||||
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) {
|
||||
var session = this.getSession();
|
||||
|
|
@ -370,6 +377,7 @@ var Editor = function(renderer, session) {
|
|||
session.$selectionMarker = session.addMarker(range, "ace_selection", style);
|
||||
} else {
|
||||
this.$updateHighlightActiveLine();
|
||||
this.$updateHighlightGutterLine();
|
||||
}
|
||||
|
||||
if (this.$highlightSelectedWord)
|
||||
|
|
@ -408,6 +416,7 @@ var Editor = function(renderer, session) {
|
|||
// Update the active line marker as due to folding changes the current
|
||||
// line range on the screen might have changed.
|
||||
this.$updateHighlightActiveLine();
|
||||
this.$updateHighlightGutterLine();
|
||||
// TODO: This might be too much updating. Okay for now.
|
||||
this.renderer.updateFull();
|
||||
};
|
||||
|
|
@ -573,7 +582,8 @@ var Editor = function(renderer, session) {
|
|||
|
||||
this.$highlightActiveLine = true;
|
||||
this.setHighlightActiveLine = function(shouldHighlight) {
|
||||
if (this.$highlightActiveLine == shouldHighlight) return;
|
||||
if (this.$highlightActiveLine == shouldHighlight)
|
||||
return;
|
||||
|
||||
this.$highlightActiveLine = shouldHighlight;
|
||||
this.$updateHighlightActiveLine();
|
||||
|
|
@ -582,6 +592,19 @@ var Editor = function(renderer, session) {
|
|||
this.getHighlightActiveLine = function() {
|
||||
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.setHighlightSelectedWord = function(shouldHighlight) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue