Skip to content

Commit b2c6bfb

Browse files
authored
Merge pull request microsoft#186926 from yshaojun/fix/175476
fix: color hints may display twice(microsoft#175476)
2 parents 35573c4 + b288ef1 commit b2c6bfb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/vs/editor/common/viewModel/modelLineProjection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class ModelLineProjection implements IModelLineProjection {
193193
if (options.inlineClassName) {
194194
const offset = (outputLineIndex > 0 ? lineBreakData.wrappedTextIndentLength : 0);
195195
const start = offset + Math.max(injectedTextStartOffsetInInputWithInjections - lineStartOffsetInInputWithInjections, 0);
196-
const end = offset + Math.min(injectedTextEndOffsetInInputWithInjections - lineStartOffsetInInputWithInjections, lineEndOffsetInInputWithInjections);
196+
const end = offset + Math.min(injectedTextEndOffsetInInputWithInjections - lineStartOffsetInInputWithInjections, lineEndOffsetInInputWithInjections - lineStartOffsetInInputWithInjections);
197197
if (start !== end) {
198198
inlineDecorations.push(new SingleLineInlineDecoration(start, end, options.inlineClassName, options.inlineClassNameAffectsLetterSpacing!));
199199
}

src/vs/editor/test/browser/viewModel/modelLineProjection.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ suite('SplitLinesCollection', () => {
921921
})),
922922
[
923923
{ inlineDecorations: [{ startOffset: 8, endOffset: 23 }] },
924-
{ inlineDecorations: [{ startOffset: 4, endOffset: 42 }] },
924+
{ inlineDecorations: [{ startOffset: 4, endOffset: 30 }] },
925925
{ inlineDecorations: [{ startOffset: 4, endOffset: 16 }] },
926926
{ inlineDecorations: undefined },
927927
{ inlineDecorations: undefined },

0 commit comments

Comments
 (0)