Skip to content

Commit 17b1aaf

Browse files
committed
Rename to cursorWidth as per feedback
1 parent 123ce8a commit 17b1aaf

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class ViewCursor {
5454
this._cursorStyle = this._context.configuration.editor.viewInfo.cursorStyle;
5555
this._lineHeight = this._context.configuration.editor.lineHeight;
5656
this._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth;
57-
this._lineCursorWidth = Math.min(this._context.configuration.editor.viewInfo.lineCursorWidth, this._typicalHalfwidthCharacterWidth);
57+
this._lineCursorWidth = Math.min(this._context.configuration.editor.viewInfo.cursorWidth, this._typicalHalfwidthCharacterWidth);
5858

5959
this._isVisible = true;
6060

@@ -105,7 +105,7 @@ export class ViewCursor {
105105
}
106106
if (e.viewInfo) {
107107
this._cursorStyle = this._context.configuration.editor.viewInfo.cursorStyle;
108-
this._lineCursorWidth = Math.min(this._context.configuration.editor.viewInfo.lineCursorWidth, this._typicalHalfwidthCharacterWidth);
108+
this._lineCursorWidth = Math.min(this._context.configuration.editor.viewInfo.cursorWidth, this._typicalHalfwidthCharacterWidth);
109109
}
110110

111111
return true;
@@ -128,7 +128,7 @@ export class ViewCursor {
128128
let width: number;
129129
if (this._cursorStyle === TextEditorCursorStyle.Line) {
130130
width = dom.computeScreenAwareSize(this._lineCursorWidth > 0 ? this._lineCursorWidth : 2);
131-
if (this._lineCursorWidth > 2) {
131+
if (width > 2) {
132132
const lineContent = this._context.model.getLineContent(this._position.lineNumber);
133133
textContent = lineContent.charAt(this._position.column - 1);
134134
}

src/vs/editor/common/config/commonEditorConfig.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,10 @@ const editorConfiguration: IConfigurationNode = {
528528
'default': editorOptions.cursorStyleToString(EDITOR_DEFAULTS.viewInfo.cursorStyle),
529529
'description': nls.localize('cursorStyle', "Controls the cursor style, accepted values are 'block', 'block-outline', 'line', 'line-thin', 'underline' and 'underline-thin'")
530530
},
531-
'editor.lineCursorWidth': {
531+
'editor.cursorWidth': {
532532
'type': 'integer',
533-
'default': EDITOR_DEFAULTS.viewInfo.lineCursorWidth,
534-
'description': nls.localize('lineCursorWidth', "Controls the width of the cursor when editor.cursorStyle is set to 'line'")
533+
'default': EDITOR_DEFAULTS.viewInfo.cursorWidth,
534+
'description': nls.localize('cursorWidth', "Controls the width of the cursor when editor.cursorStyle is set to 'line'")
535535
},
536536
'editor.fontLigatures': {
537537
'type': 'boolean',

src/vs/editor/common/config/editorOptions.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ export interface IEditorOptions {
264264
/**
265265
* Control the width of the cursor when cursorStyle is set to 'line'
266266
*/
267-
lineCursorWidth?: number;
267+
cursorWidth?: number;
268268
/**
269269
* Enable font ligatures.
270270
* Defaults to false.
@@ -800,7 +800,7 @@ export interface InternalEditorViewOptions {
800800
readonly cursorBlinking: TextEditorCursorBlinkingStyle;
801801
readonly mouseWheelZoom: boolean;
802802
readonly cursorStyle: TextEditorCursorStyle;
803-
readonly lineCursorWidth: number;
803+
readonly cursorWidth: number;
804804
readonly hideCursorInOverviewRuler: boolean;
805805
readonly scrollBeyondLastLine: boolean;
806806
readonly smoothScrolling: boolean;
@@ -1071,7 +1071,7 @@ export class InternalEditorOptions {
10711071
&& a.cursorBlinking === b.cursorBlinking
10721072
&& a.mouseWheelZoom === b.mouseWheelZoom
10731073
&& a.cursorStyle === b.cursorStyle
1074-
&& a.lineCursorWidth === b.lineCursorWidth
1074+
&& a.cursorWidth === b.cursorWidth
10751075
&& a.hideCursorInOverviewRuler === b.hideCursorInOverviewRuler
10761076
&& a.scrollBeyondLastLine === b.scrollBeyondLastLine
10771077
&& a.smoothScrolling === b.smoothScrolling
@@ -1672,7 +1672,7 @@ export class EditorOptionsValidator {
16721672
cursorBlinking: _cursorBlinkingStyleFromString(opts.cursorBlinking, defaults.cursorBlinking),
16731673
mouseWheelZoom: _boolean(opts.mouseWheelZoom, defaults.mouseWheelZoom),
16741674
cursorStyle: _cursorStyleFromString(opts.cursorStyle, defaults.cursorStyle),
1675-
lineCursorWidth: _clampedInt(opts.lineCursorWidth, defaults.lineCursorWidth, 1, Number.MAX_VALUE),
1675+
cursorWidth: _clampedInt(opts.cursorWidth, defaults.cursorWidth, 0, Number.MAX_VALUE),
16761676
hideCursorInOverviewRuler: _boolean(opts.hideCursorInOverviewRuler, defaults.hideCursorInOverviewRuler),
16771677
scrollBeyondLastLine: _boolean(opts.scrollBeyondLastLine, defaults.scrollBeyondLastLine),
16781678
smoothScrolling: _boolean(opts.smoothScrolling, defaults.smoothScrolling),
@@ -1776,7 +1776,7 @@ export class InternalEditorOptionsFactory {
17761776
cursorBlinking: opts.viewInfo.cursorBlinking,
17771777
mouseWheelZoom: opts.viewInfo.mouseWheelZoom,
17781778
cursorStyle: opts.viewInfo.cursorStyle,
1779-
lineCursorWidth: opts.viewInfo.lineCursorWidth,
1779+
cursorWidth: opts.viewInfo.cursorWidth,
17801780
hideCursorInOverviewRuler: opts.viewInfo.hideCursorInOverviewRuler,
17811781
scrollBeyondLastLine: opts.viewInfo.scrollBeyondLastLine,
17821782
smoothScrolling: opts.viewInfo.smoothScrolling,
@@ -2218,7 +2218,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
22182218
cursorBlinking: TextEditorCursorBlinkingStyle.Blink,
22192219
mouseWheelZoom: false,
22202220
cursorStyle: TextEditorCursorStyle.Line,
2221-
lineCursorWidth: 2,
2221+
cursorWidth: 0,
22222222
hideCursorInOverviewRuler: false,
22232223
scrollBeyondLastLine: true,
22242224
smoothScrolling: false,

src/vs/monaco.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2546,7 +2546,7 @@ declare module monaco.editor {
25462546
/**
25472547
* Control the width of the cursor when cursorStyle is set to 'line'
25482548
*/
2549-
lineCursorWidth?: number;
2549+
cursorWidth?: number;
25502550
/**
25512551
* Enable font ligatures.
25522552
* Defaults to false.
@@ -3017,7 +3017,7 @@ declare module monaco.editor {
30173017
readonly cursorBlinking: TextEditorCursorBlinkingStyle;
30183018
readonly mouseWheelZoom: boolean;
30193019
readonly cursorStyle: TextEditorCursorStyle;
3020-
readonly lineCursorWidth: number;
3020+
readonly cursorWidth: number;
30213021
readonly hideCursorInOverviewRuler: boolean;
30223022
readonly scrollBeyondLastLine: boolean;
30233023
readonly smoothScrolling: boolean;

0 commit comments

Comments
 (0)