Skip to content

Commit

Permalink
fix(highlight): do not widen the decoration's range
Browse files Browse the repository at this point in the history
Fix: #1531
  • Loading branch information
xiyaowong committed Oct 13, 2023
1 parent ecf1665 commit deb41d4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/highlight_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { cloneDeep } from "lodash-es";
import wcswidth from "ts-wcwidth";
import {
DecorationOptions,
DecorationRangeBehavior,
Range,
TextEditor,
TextEditorDecorationType,
Expand Down Expand Up @@ -160,7 +161,10 @@ export class HighlightProvider {
}

private createDecoratorForHighlightId(id: number, options: ThemableDecorationRenderOptions): void {
const decorator = window.createTextEditorDecorationType(options);
const decorator = window.createTextEditorDecorationType({
...options,
rangeBehavior: DecorationRangeBehavior.ClosedClosed,
});
this.decoratorConfigurations.set(decorator, options);
this.highlighIdToDecorator.set(id, decorator);
}
Expand Down

0 comments on commit deb41d4

Please sign in to comment.