Highlight Gutter Line without redrawing whole gutter
This commit is contained in:
parent
5527015a9a
commit
0217dd2940
3 changed files with 48 additions and 29 deletions
|
|
@ -455,7 +455,6 @@ var Editor = function(renderer, session) {
|
|||
|
||||
this.$highlightBrackets();
|
||||
this.$updateHighlightActiveLine();
|
||||
this.$updateHighlightGutterLine();
|
||||
};
|
||||
|
||||
/** internal, hide
|
||||
|
|
@ -487,21 +486,6 @@ var Editor = function(renderer, session) {
|
|||
}
|
||||
};
|
||||
|
||||
/** internal, hide
|
||||
* Editor.$updateHighlightGutterLine()
|
||||
*
|
||||
*
|
||||
**/
|
||||
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");
|
||||
}
|
||||
|
||||
/**
|
||||
* Editor@onSelectionChange(e)
|
||||
|
|
@ -523,7 +507,6 @@ var Editor = function(renderer, session) {
|
|||
session.$selectionMarker = session.addMarker(range, "ace_selection", style);
|
||||
} else {
|
||||
this.$updateHighlightActiveLine();
|
||||
this.$updateHighlightGutterLine();
|
||||
}
|
||||
|
||||
if (this.$highlightSelectedWord)
|
||||
|
|
@ -602,7 +585,6 @@ 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();
|
||||
};
|
||||
|
|
@ -888,12 +870,11 @@ var Editor = function(renderer, session) {
|
|||
};
|
||||
|
||||
this.$highlightGutterLine = true;
|
||||
this.setHighlightGutterLine = function(shouldHighlightGutterLine) {
|
||||
if (this.$highlightGutterLine == shouldHighlightGutterLine)
|
||||
this.setHighlightGutterLine = function(shouldHighlight) {
|
||||
if (this.$highlightGutterLine == shouldHighlight)
|
||||
return;
|
||||
|
||||
this.$highlightGutterLine = shouldHighlightGutterLine;
|
||||
this.$updateHighlightGutterLine();
|
||||
this.renderer.setHighlightGutterLine(shouldHighlight);
|
||||
};
|
||||
|
||||
this.getHighlightGutterLine = function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue