diff --git a/src/vs/editor/browser/widget/media/editor.css b/src/vs/editor/browser/widget/media/editor.css index 586ffaa01851b909340373ecba9b4a9fa29be8d8..22c953f1024822db4ecd9b4a63943bc7ca31a942 100644 --- a/src/vs/editor/browser/widget/media/editor.css +++ b/src/vs/editor/browser/widget/media/editor.css @@ -112,11 +112,11 @@ top: 0; } -/* -------------------- Highlight a line -------------------- */ +/* -------------------- Highlight a range -------------------- */ -.monaco-editor.vs .lineHighlight { background: rgba(253, 255, 0, 0.2); } -.monaco-editor.vs-dark .lineHighlight { background: rgba(243, 240, 245, 0.2); } -.monaco-editor.hc-black .lineHighlight { background: rgba(243, 240, 245, 0.2); } +.monaco-editor.vs .rangeHighlight { background: rgba(253, 255, 0, 0.2); } +.monaco-editor.vs-dark .rangeHighlight { background: rgba(243, 240, 245, 0.2); } +.monaco-editor.hc-black .rangeHighlight { background: rgba(243, 240, 245, 0.2); } /* -------------------- Squigglies -------------------- */ diff --git a/src/vs/editor/contrib/find/common/findDecorations.ts b/src/vs/editor/contrib/find/common/findDecorations.ts index 364ea1f3c56346de1eea4cfe4ac96110d67daac8..d1e853f2d2d83b4c698e7c782a33fb906a7847b4 100644 --- a/src/vs/editor/contrib/find/common/findDecorations.ts +++ b/src/vs/editor/contrib/find/common/findDecorations.ts @@ -14,7 +14,7 @@ export class FindDecorations implements IDisposable { private _editor:editorCommon.ICommonCodeEditor; private _decorations:string[]; private _findScopeDecorationId:string; - private _lineHighlightDecorationId:string; + private _rangeHighlightDecorationId:string; private _highlightedDecorationId:string; private _startPosition:Position; @@ -22,7 +22,7 @@ export class FindDecorations implements IDisposable { this._editor = editor; this._decorations = []; this._findScopeDecorationId = null; - this._lineHighlightDecorationId = null; + this._rangeHighlightDecorationId = null; this._highlightedDecorationId = null; this._startPosition = this._editor.getPosition(); } @@ -33,7 +33,7 @@ export class FindDecorations implements IDisposable { this._editor = null; this._decorations = []; this._findScopeDecorationId = null; - this._lineHighlightDecorationId = null; + this._rangeHighlightDecorationId = null; this._highlightedDecorationId = null; this._startPosition = null; } @@ -41,7 +41,7 @@ export class FindDecorations implements IDisposable { public reset(): void { this._decorations = []; this._findScopeDecorationId = null; - this._lineHighlightDecorationId = null; + this._rangeHighlightDecorationId = null; this._highlightedDecorationId = null; } @@ -99,13 +99,13 @@ export class FindDecorations implements IDisposable { this._highlightedDecorationId = newCurrentDecorationId; changeAccessor.changeDecorationOptions(this._highlightedDecorationId, FindDecorations.createFindMatchDecorationOptions(true)); } - if (this._lineHighlightDecorationId !== null) { - changeAccessor.removeDecoration(this._lineHighlightDecorationId); - this._lineHighlightDecorationId = null; + if (this._rangeHighlightDecorationId !== null) { + changeAccessor.removeDecoration(this._rangeHighlightDecorationId); + this._rangeHighlightDecorationId = null; } if (newCurrentDecorationId !== null) { let rng = this._editor.getModel().getDecorationRange(newCurrentDecorationId); - this._lineHighlightDecorationId = changeAccessor.addDecoration(rng, FindDecorations.createLineHighlightDecoration()); + this._rangeHighlightDecorationId = changeAccessor.addDecoration(rng, FindDecorations.createRangeHighlightDecoration()); } }); } @@ -134,7 +134,7 @@ export class FindDecorations implements IDisposable { this._findScopeDecorationId = null; } this._decorations = tmpDecorations; - this._lineHighlightDecorationId = null; + this._rangeHighlightDecorationId = null; this._highlightedDecorationId = null; } @@ -144,8 +144,8 @@ export class FindDecorations implements IDisposable { if (this._findScopeDecorationId) { result.push(this._findScopeDecorationId); } - if (this._lineHighlightDecorationId) { - result.push(this._lineHighlightDecorationId); + if (this._rangeHighlightDecorationId) { + result.push(this._rangeHighlightDecorationId); } return result; } @@ -162,10 +162,10 @@ export class FindDecorations implements IDisposable { }; } - private static createLineHighlightDecoration(): editorCommon.IModelDecorationOptions { + private static createRangeHighlightDecoration(): editorCommon.IModelDecorationOptions { return { stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, - className: 'lineHighlight', + className: 'rangeHighlight', isWholeLine: true }; } diff --git a/src/vs/editor/contrib/quickOpen/browser/editorQuickOpen.ts b/src/vs/editor/contrib/quickOpen/browser/editorQuickOpen.ts index 9ff25a95df53ad110246e5ba51d9f237d2fd6c32..33d5af9ae82b86c41706a8e7e46ea41bfe394a1f 100644 --- a/src/vs/editor/contrib/quickOpen/browser/editorQuickOpen.ts +++ b/src/vs/editor/contrib/quickOpen/browser/editorQuickOpen.ts @@ -29,7 +29,7 @@ export class QuickOpenController implements editorCommon.IEditorContribution { private editor:ICodeEditor; private widget:QuickOpenEditorWidget; - private lineHighlightDecorationId:string; + private rangeHighlightDecorationId:string; private lastKnownEditorSelection:Selection; constructor(editor:ICodeEditor) { @@ -93,31 +93,31 @@ export class QuickOpenController implements editorCommon.IEditorContribution { public decorateLine(range:editorCommon.IRange, editor:ICodeEditor):void { editor.changeDecorations((changeAccessor:editorCommon.IModelDecorationsChangeAccessor)=>{ var oldDecorations: string[] = []; - if (this.lineHighlightDecorationId) { - oldDecorations.push(this.lineHighlightDecorationId); - this.lineHighlightDecorationId = null; + if (this.rangeHighlightDecorationId) { + oldDecorations.push(this.rangeHighlightDecorationId); + this.rangeHighlightDecorationId = null; } var newDecorations: editorCommon.IModelDeltaDecoration[] = [ { range: range, options: { - className: 'lineHighlight', + className: 'rangeHighlight', isWholeLine: true } } ]; var decorations = changeAccessor.deltaDecorations(oldDecorations, newDecorations); - this.lineHighlightDecorationId = decorations[0]; + this.rangeHighlightDecorationId = decorations[0]; }); } public clearDecorations():void { - if (this.lineHighlightDecorationId) { + if (this.rangeHighlightDecorationId) { this.editor.changeDecorations((changeAccessor:editorCommon.IModelDecorationsChangeAccessor)=>{ - changeAccessor.deltaDecorations([this.lineHighlightDecorationId], []); - this.lineHighlightDecorationId = null; + changeAccessor.deltaDecorations([this.rangeHighlightDecorationId], []); + this.rangeHighlightDecorationId = null; }); } } diff --git a/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts b/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts index e4a7285491ba505d20f12dc1389877e3e959e9f5..9f58e3c277c3975da39309d4768d21fcbbc85ba4 100644 --- a/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/gotoLineHandler.ts @@ -161,13 +161,13 @@ class GotoLineEntry extends EditorQuickOpenEntry { } interface IEditorLineDecoration { - lineHighlightId: string; + rangeHighlightId: string; lineDecorationId: string; position: Position; } export class GotoLineHandler extends QuickOpenHandler { - private lineHighlightDecorationId: IEditorLineDecoration; + private rangeHighlightDecorationId: IEditorLineDecoration; private lastKnownEditorViewState: IEditorViewState; constructor( @IWorkbenchEditorService private editorService: IWorkbenchEditorService) { @@ -200,18 +200,18 @@ export class GotoLineHandler extends QuickOpenHandler { editor.changeDecorations((changeAccessor: IModelDecorationsChangeAccessor) => { let deleteDecorations: string[] = []; - if (this.lineHighlightDecorationId) { - deleteDecorations.push(this.lineHighlightDecorationId.lineDecorationId); - deleteDecorations.push(this.lineHighlightDecorationId.lineHighlightId); - this.lineHighlightDecorationId = null; + if (this.rangeHighlightDecorationId) { + deleteDecorations.push(this.rangeHighlightDecorationId.lineDecorationId); + deleteDecorations.push(this.rangeHighlightDecorationId.rangeHighlightId); + this.rangeHighlightDecorationId = null; } let newDecorations: IModelDeltaDecoration[] = [ - // lineHighlight at index 0 + // rangeHighlight at index 0 { range: range, options: { - className: 'lineHighlight', + className: 'rangeHighlight', isWholeLine: true } }, @@ -230,11 +230,11 @@ export class GotoLineHandler extends QuickOpenHandler { ]; let decorations = changeAccessor.deltaDecorations(deleteDecorations, newDecorations); - let lineHighlightId = decorations[0]; + let rangeHighlightId = decorations[0]; let lineDecorationId = decorations[1]; - this.lineHighlightDecorationId = { - lineHighlightId: lineHighlightId, + this.rangeHighlightDecorationId = { + rangeHighlightId: rangeHighlightId, lineDecorationId: lineDecorationId, position: position }; @@ -242,20 +242,20 @@ export class GotoLineHandler extends QuickOpenHandler { } public clearDecorations(): void { - if (this.lineHighlightDecorationId) { + if (this.rangeHighlightDecorationId) { this.editorService.getVisibleEditors().forEach((editor) => { - if (editor.position === this.lineHighlightDecorationId.position) { + if (editor.position === this.rangeHighlightDecorationId.position) { let editorControl = editor.getControl(); editorControl.changeDecorations((changeAccessor: IModelDecorationsChangeAccessor) => { changeAccessor.deltaDecorations([ - this.lineHighlightDecorationId.lineDecorationId, - this.lineHighlightDecorationId.lineHighlightId + this.rangeHighlightDecorationId.lineDecorationId, + this.rangeHighlightDecorationId.rangeHighlightId ], []); }); } }); - this.lineHighlightDecorationId = null; + this.rangeHighlightDecorationId = null; } } diff --git a/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts b/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts index 7b610c49e164f8f4c62df9cc7c903dd858a1723a..76bb6e93b2c210cea70b769d3c1e574755bca2fd 100644 --- a/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts +++ b/src/vs/workbench/parts/quickopen/browser/gotoSymbolHandler.ts @@ -363,14 +363,14 @@ interface Outline { } interface IEditorLineDecoration { - lineHighlightId: string; + rangeHighlightId: string; lineDecorationId: string; position: Position; } export class GotoSymbolHandler extends QuickOpenHandler { private outlineToModelCache: { [modelId: string]: OutlineModel; }; - private lineHighlightDecorationId: IEditorLineDecoration; + private rangeHighlightDecorationId: IEditorLineDecoration; private lastKnownEditorViewState: IEditorViewState; private activeOutlineRequest: TPromise; @@ -509,19 +509,19 @@ export class GotoSymbolHandler extends QuickOpenHandler { editor.changeDecorations((changeAccessor: IModelDecorationsChangeAccessor) => { let deleteDecorations: string[] = []; - if (this.lineHighlightDecorationId) { - deleteDecorations.push(this.lineHighlightDecorationId.lineDecorationId); - deleteDecorations.push(this.lineHighlightDecorationId.lineHighlightId); - this.lineHighlightDecorationId = null; + if (this.rangeHighlightDecorationId) { + deleteDecorations.push(this.rangeHighlightDecorationId.lineDecorationId); + deleteDecorations.push(this.rangeHighlightDecorationId.rangeHighlightId); + this.rangeHighlightDecorationId = null; } let newDecorations: IModelDeltaDecoration[] = [ - // lineHighlight at index 0 + // rangeHighlight at index 0 { range: fullRange, options: { - className: 'lineHighlight', + className: 'rangeHighlight', isWholeLine: true } }, @@ -541,11 +541,11 @@ export class GotoSymbolHandler extends QuickOpenHandler { ]; let decorations = changeAccessor.deltaDecorations(deleteDecorations, newDecorations); - let lineHighlightId = decorations[0]; + let rangeHighlightId = decorations[0]; let lineDecorationId = decorations[1]; - this.lineHighlightDecorationId = { - lineHighlightId: lineHighlightId, + this.rangeHighlightDecorationId = { + rangeHighlightId: rangeHighlightId, lineDecorationId: lineDecorationId, position: position }; @@ -553,20 +553,20 @@ export class GotoSymbolHandler extends QuickOpenHandler { } public clearDecorations(): void { - if (this.lineHighlightDecorationId) { + if (this.rangeHighlightDecorationId) { this.editorService.getVisibleEditors().forEach((editor) => { - if (editor.position === this.lineHighlightDecorationId.position) { + if (editor.position === this.rangeHighlightDecorationId.position) { let editorControl = editor.getControl(); editorControl.changeDecorations((changeAccessor: IModelDecorationsChangeAccessor) => { changeAccessor.deltaDecorations([ - this.lineHighlightDecorationId.lineDecorationId, - this.lineHighlightDecorationId.lineHighlightId + this.rangeHighlightDecorationId.lineDecorationId, + this.rangeHighlightDecorationId.rangeHighlightId ], []); }); } }); - this.lineHighlightDecorationId = null; + this.rangeHighlightDecorationId = null; } }