Skip to content

Commit a449148

Browse files
authored
Keep block cursor as wide as a typical character when it sits on a tab (microsoft#153859)
Fixes microsoft#151959: Keep block cursor as wide as a typical character when it sits on a tab
1 parent e777525 commit a449148

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,13 @@ export class ViewCursor {
172172
}
173173

174174
const range = firstVisibleRangeForCharacter.ranges[0];
175-
const width = range.width < 1 ? this._typicalHalfwidthCharacterWidth : range.width;
175+
const width = (
176+
nextGrapheme === '\t'
177+
? this._typicalHalfwidthCharacterWidth
178+
: (range.width < 1
179+
? this._typicalHalfwidthCharacterWidth
180+
: range.width)
181+
);
176182

177183
let textContentClassName = '';
178184
if (this._cursorStyle === TextEditorCursorStyle.Block) {

0 commit comments

Comments
 (0)