Skip to content

Commit

Permalink
Keep block cursor as wide as a typical character when it sits on a tab (
Browse files Browse the repository at this point in the history
#153859)

Fixes #151959: Keep block cursor as wide as a typical character when it sits on a tab
  • Loading branch information
alexdima committed Jun 30, 2022
1 parent e777525 commit a449148
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/vs/editor/browser/viewParts/viewCursors/viewCursor.ts
Expand Up @@ -172,7 +172,13 @@ export class ViewCursor {
}

const range = firstVisibleRangeForCharacter.ranges[0];
const width = range.width < 1 ? this._typicalHalfwidthCharacterWidth : range.width;
const width = (
nextGrapheme === '\t'
? this._typicalHalfwidthCharacterWidth
: (range.width < 1
? this._typicalHalfwidthCharacterWidth
: range.width)
);

let textContentClassName = '';
if (this._cursorStyle === TextEditorCursorStyle.Block) {
Expand Down

0 comments on commit a449148

Please sign in to comment.