Rename to cursorWidth as per feedback
This commit is contained in:
parent
123ce8a0ba
commit
17b1aaf768
4 changed files with 14 additions and 14 deletions
|
@ -54,7 +54,7 @@ export class ViewCursor {
|
|||
this._cursorStyle = this._context.configuration.editor.viewInfo.cursorStyle;
|
||||
this._lineHeight = this._context.configuration.editor.lineHeight;
|
||||
this._typicalHalfwidthCharacterWidth = this._context.configuration.editor.fontInfo.typicalHalfwidthCharacterWidth;
|
||||
this._lineCursorWidth = Math.min(this._context.configuration.editor.viewInfo.lineCursorWidth, this._typicalHalfwidthCharacterWidth);
|
||||
this._lineCursorWidth = Math.min(this._context.configuration.editor.viewInfo.cursorWidth, this._typicalHalfwidthCharacterWidth);
|
||||
|
||||
this._isVisible = true;
|
||||
|
||||
|
@ -105,7 +105,7 @@ export class ViewCursor {
|
|||
}
|
||||
if (e.viewInfo) {
|
||||
this._cursorStyle = this._context.configuration.editor.viewInfo.cursorStyle;
|
||||
this._lineCursorWidth = Math.min(this._context.configuration.editor.viewInfo.lineCursorWidth, this._typicalHalfwidthCharacterWidth);
|
||||
this._lineCursorWidth = Math.min(this._context.configuration.editor.viewInfo.cursorWidth, this._typicalHalfwidthCharacterWidth);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -128,7 +128,7 @@ export class ViewCursor {
|
|||
let width: number;
|
||||
if (this._cursorStyle === TextEditorCursorStyle.Line) {
|
||||
width = dom.computeScreenAwareSize(this._lineCursorWidth > 0 ? this._lineCursorWidth : 2);
|
||||
if (this._lineCursorWidth > 2) {
|
||||
if (width > 2) {
|
||||
const lineContent = this._context.model.getLineContent(this._position.lineNumber);
|
||||
textContent = lineContent.charAt(this._position.column - 1);
|
||||
}
|
||||
|
|
|
@ -528,10 +528,10 @@ const editorConfiguration: IConfigurationNode = {
|
|||
'default': editorOptions.cursorStyleToString(EDITOR_DEFAULTS.viewInfo.cursorStyle),
|
||||
'description': nls.localize('cursorStyle', "Controls the cursor style, accepted values are 'block', 'block-outline', 'line', 'line-thin', 'underline' and 'underline-thin'")
|
||||
},
|
||||
'editor.lineCursorWidth': {
|
||||
'editor.cursorWidth': {
|
||||
'type': 'integer',
|
||||
'default': EDITOR_DEFAULTS.viewInfo.lineCursorWidth,
|
||||
'description': nls.localize('lineCursorWidth', "Controls the width of the cursor when editor.cursorStyle is set to 'line'")
|
||||
'default': EDITOR_DEFAULTS.viewInfo.cursorWidth,
|
||||
'description': nls.localize('cursorWidth', "Controls the width of the cursor when editor.cursorStyle is set to 'line'")
|
||||
},
|
||||
'editor.fontLigatures': {
|
||||
'type': 'boolean',
|
||||
|
|
|
@ -264,7 +264,7 @@ export interface IEditorOptions {
|
|||
/**
|
||||
* Control the width of the cursor when cursorStyle is set to 'line'
|
||||
*/
|
||||
lineCursorWidth?: number;
|
||||
cursorWidth?: number;
|
||||
/**
|
||||
* Enable font ligatures.
|
||||
* Defaults to false.
|
||||
|
@ -800,7 +800,7 @@ export interface InternalEditorViewOptions {
|
|||
readonly cursorBlinking: TextEditorCursorBlinkingStyle;
|
||||
readonly mouseWheelZoom: boolean;
|
||||
readonly cursorStyle: TextEditorCursorStyle;
|
||||
readonly lineCursorWidth: number;
|
||||
readonly cursorWidth: number;
|
||||
readonly hideCursorInOverviewRuler: boolean;
|
||||
readonly scrollBeyondLastLine: boolean;
|
||||
readonly smoothScrolling: boolean;
|
||||
|
@ -1071,7 +1071,7 @@ export class InternalEditorOptions {
|
|||
&& a.cursorBlinking === b.cursorBlinking
|
||||
&& a.mouseWheelZoom === b.mouseWheelZoom
|
||||
&& a.cursorStyle === b.cursorStyle
|
||||
&& a.lineCursorWidth === b.lineCursorWidth
|
||||
&& a.cursorWidth === b.cursorWidth
|
||||
&& a.hideCursorInOverviewRuler === b.hideCursorInOverviewRuler
|
||||
&& a.scrollBeyondLastLine === b.scrollBeyondLastLine
|
||||
&& a.smoothScrolling === b.smoothScrolling
|
||||
|
@ -1672,7 +1672,7 @@ export class EditorOptionsValidator {
|
|||
cursorBlinking: _cursorBlinkingStyleFromString(opts.cursorBlinking, defaults.cursorBlinking),
|
||||
mouseWheelZoom: _boolean(opts.mouseWheelZoom, defaults.mouseWheelZoom),
|
||||
cursorStyle: _cursorStyleFromString(opts.cursorStyle, defaults.cursorStyle),
|
||||
lineCursorWidth: _clampedInt(opts.lineCursorWidth, defaults.lineCursorWidth, 1, Number.MAX_VALUE),
|
||||
cursorWidth: _clampedInt(opts.cursorWidth, defaults.cursorWidth, 0, Number.MAX_VALUE),
|
||||
hideCursorInOverviewRuler: _boolean(opts.hideCursorInOverviewRuler, defaults.hideCursorInOverviewRuler),
|
||||
scrollBeyondLastLine: _boolean(opts.scrollBeyondLastLine, defaults.scrollBeyondLastLine),
|
||||
smoothScrolling: _boolean(opts.smoothScrolling, defaults.smoothScrolling),
|
||||
|
@ -1776,7 +1776,7 @@ export class InternalEditorOptionsFactory {
|
|||
cursorBlinking: opts.viewInfo.cursorBlinking,
|
||||
mouseWheelZoom: opts.viewInfo.mouseWheelZoom,
|
||||
cursorStyle: opts.viewInfo.cursorStyle,
|
||||
lineCursorWidth: opts.viewInfo.lineCursorWidth,
|
||||
cursorWidth: opts.viewInfo.cursorWidth,
|
||||
hideCursorInOverviewRuler: opts.viewInfo.hideCursorInOverviewRuler,
|
||||
scrollBeyondLastLine: opts.viewInfo.scrollBeyondLastLine,
|
||||
smoothScrolling: opts.viewInfo.smoothScrolling,
|
||||
|
@ -2218,7 +2218,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
|
|||
cursorBlinking: TextEditorCursorBlinkingStyle.Blink,
|
||||
mouseWheelZoom: false,
|
||||
cursorStyle: TextEditorCursorStyle.Line,
|
||||
lineCursorWidth: 2,
|
||||
cursorWidth: 0,
|
||||
hideCursorInOverviewRuler: false,
|
||||
scrollBeyondLastLine: true,
|
||||
smoothScrolling: false,
|
||||
|
|
4
src/vs/monaco.d.ts
vendored
4
src/vs/monaco.d.ts
vendored
|
@ -2546,7 +2546,7 @@ declare module monaco.editor {
|
|||
/**
|
||||
* Control the width of the cursor when cursorStyle is set to 'line'
|
||||
*/
|
||||
lineCursorWidth?: number;
|
||||
cursorWidth?: number;
|
||||
/**
|
||||
* Enable font ligatures.
|
||||
* Defaults to false.
|
||||
|
@ -3017,7 +3017,7 @@ declare module monaco.editor {
|
|||
readonly cursorBlinking: TextEditorCursorBlinkingStyle;
|
||||
readonly mouseWheelZoom: boolean;
|
||||
readonly cursorStyle: TextEditorCursorStyle;
|
||||
readonly lineCursorWidth: number;
|
||||
readonly cursorWidth: number;
|
||||
readonly hideCursorInOverviewRuler: boolean;
|
||||
readonly scrollBeyondLastLine: boolean;
|
||||
readonly smoothScrolling: boolean;
|
||||
|
|
Loading…
Reference in a new issue