Skip to content

Commit

Permalink
polishing some more
Browse files Browse the repository at this point in the history
  • Loading branch information
aiday-mar committed Nov 21, 2024
1 parent 6f706c0 commit 2ecbd60
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 129 deletions.
13 changes: 7 additions & 6 deletions src/vs/editor/common/commands/replaceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,14 @@ export class ReplaceOvertypeCommandInComposition implements ICommand {

public getEditOperations(model: ITextModel, builder: IEditOperationBuilder): void {
const text = model.getValueInRange(this._range);
const startPosition = this._range.getStartPosition();
let endPosition = addPositiveDeltaToModelPosition(model, startPosition, 2 * text.length);
if (endPosition.lineNumber > this._range.endLineNumber) {
endPosition = new Position(this._range.endLineNumber, model.getLineMaxColumn(this._range.endLineNumber));
const initialEndPosition = this._range.getEndPosition();
const initialEndLineNumber = initialEndPosition.lineNumber;
let endPosition = addPositiveDeltaToModelPosition(model, initialEndPosition, text.length);
if (endPosition.lineNumber > initialEndLineNumber) {
endPosition = new Position(initialEndLineNumber, model.getLineMaxColumn(initialEndLineNumber));
}
const replaceRange = Range.fromPositions(startPosition, endPosition);
builder.addTrackedEditOperation(replaceRange, text);
const replaceRange = Range.fromPositions(initialEndPosition, endPosition);
builder.addTrackedEditOperation(replaceRange, '');
}

public computeCursorState(model: ITextModel, helper: ICursorStateComputerData): Selection {
Expand Down
14 changes: 7 additions & 7 deletions src/vs/editor/common/config/editorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ export interface IEditorOptions {
* Defaults to 'block'.
*/
overtypeCursorStyle?: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin';
/**
* Controls whether paste in overtype mode should overwrite or insert.
*/
overtypeOnPaste?: boolean;
/**
* Control the width of the cursor when cursorStyle is set to 'line'
*/
Expand Down Expand Up @@ -778,11 +782,6 @@ export interface IEditorOptions {
* Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.
*/
inlineCompletionsAccessibilityVerbose?: boolean;

/**
* Controls whether paste in overtype mode should overwrite or insert.
*/
overtypeOnPaste?: boolean;
}

/**
Expand Down Expand Up @@ -5381,7 +5380,6 @@ export const enum EditorOption {
cursorBlinking,
cursorSmoothCaretAnimation,
cursorStyle,
overtypeCursorStyle,
cursorSurroundingLines,
cursorSurroundingLinesStyle,
cursorWidth,
Expand Down Expand Up @@ -5437,6 +5435,7 @@ export const enum EditorOption {
multiCursorLimit,
occurrencesHighlight,
occurrencesHighlightDelay,
overtypeCursorStyle,
overtypeOnPaste,
overviewRulerBorder,
overviewRulerLanes,
Expand Down Expand Up @@ -5990,7 +5989,8 @@ export const EditorOptions = {
}
)),
overtypeOnPaste: register(new EditorBooleanOption(
EditorOption.overtypeOnPaste, 'overtypeOnPaste', true
EditorOption.overtypeOnPaste, 'overtypeOnPaste', true,
{ description: nls.localize('overtypeOnPaste', "Controls whether pasting should overtype.") }
)),
overviewRulerBorder: register(new EditorBooleanOption(
EditorOption.overviewRulerBorder, 'overviewRulerBorder', true,
Expand Down
112 changes: 56 additions & 56 deletions src/vs/editor/common/standalone/standaloneEnums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,62 +202,62 @@ export enum EditorOption {
cursorBlinking = 26,
cursorSmoothCaretAnimation = 27,
cursorStyle = 28,
overtypeCursorStyle = 29,
cursorSurroundingLines = 30,
cursorSurroundingLinesStyle = 31,
cursorWidth = 32,
disableLayerHinting = 33,
disableMonospaceOptimizations = 34,
domReadOnly = 35,
dragAndDrop = 36,
dropIntoEditor = 37,
experimentalEditContextEnabled = 38,
emptySelectionClipboard = 39,
experimentalGpuAcceleration = 40,
experimentalWhitespaceRendering = 41,
extraEditorClassName = 42,
fastScrollSensitivity = 43,
find = 44,
fixedOverflowWidgets = 45,
folding = 46,
foldingStrategy = 47,
foldingHighlight = 48,
foldingImportsByDefault = 49,
foldingMaximumRegions = 50,
unfoldOnClickAfterEndOfLine = 51,
fontFamily = 52,
fontInfo = 53,
fontLigatures = 54,
fontSize = 55,
fontWeight = 56,
fontVariations = 57,
formatOnPaste = 58,
formatOnType = 59,
glyphMargin = 60,
gotoLocation = 61,
hideCursorInOverviewRuler = 62,
hover = 63,
inDiffEditor = 64,
inlineSuggest = 65,
letterSpacing = 66,
lightbulb = 67,
lineDecorationsWidth = 68,
lineHeight = 69,
lineNumbers = 70,
lineNumbersMinChars = 71,
linkedEditing = 72,
links = 73,
matchBrackets = 74,
minimap = 75,
mouseStyle = 76,
mouseWheelScrollSensitivity = 77,
mouseWheelZoom = 78,
multiCursorMergeOverlapping = 79,
multiCursorModifier = 80,
multiCursorPaste = 81,
multiCursorLimit = 82,
occurrencesHighlight = 83,
occurrencesHighlightDelay = 84,
cursorSurroundingLines = 29,
cursorSurroundingLinesStyle = 30,
cursorWidth = 31,
disableLayerHinting = 32,
disableMonospaceOptimizations = 33,
domReadOnly = 34,
dragAndDrop = 35,
dropIntoEditor = 36,
experimentalEditContextEnabled = 37,
emptySelectionClipboard = 38,
experimentalGpuAcceleration = 39,
experimentalWhitespaceRendering = 40,
extraEditorClassName = 41,
fastScrollSensitivity = 42,
find = 43,
fixedOverflowWidgets = 44,
folding = 45,
foldingStrategy = 46,
foldingHighlight = 47,
foldingImportsByDefault = 48,
foldingMaximumRegions = 49,
unfoldOnClickAfterEndOfLine = 50,
fontFamily = 51,
fontInfo = 52,
fontLigatures = 53,
fontSize = 54,
fontWeight = 55,
fontVariations = 56,
formatOnPaste = 57,
formatOnType = 58,
glyphMargin = 59,
gotoLocation = 60,
hideCursorInOverviewRuler = 61,
hover = 62,
inDiffEditor = 63,
inlineSuggest = 64,
letterSpacing = 65,
lightbulb = 66,
lineDecorationsWidth = 67,
lineHeight = 68,
lineNumbers = 69,
lineNumbersMinChars = 70,
linkedEditing = 71,
links = 72,
matchBrackets = 73,
minimap = 74,
mouseStyle = 75,
mouseWheelScrollSensitivity = 76,
mouseWheelZoom = 77,
multiCursorMergeOverlapping = 78,
multiCursorModifier = 79,
multiCursorPaste = 80,
multiCursorLimit = 81,
occurrencesHighlight = 82,
occurrencesHighlightDelay = 83,
overtypeCursorStyle = 84,
overtypeOnPaste = 85,
overviewRulerBorder = 86,
overviewRulerLanes = 87,
Expand Down
120 changes: 60 additions & 60 deletions src/vs/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3293,6 +3293,10 @@ declare namespace monaco.editor {
* Defaults to 'block'.
*/
overtypeCursorStyle?: 'line' | 'block' | 'underline' | 'line-thin' | 'block-outline' | 'underline-thin';
/**
* Controls whether paste in overtype mode should overwrite or insert.
*/
overtypeOnPaste?: boolean;
/**
* Control the width of the cursor when cursorStyle is set to 'line'
*/
Expand Down Expand Up @@ -3815,10 +3819,6 @@ declare namespace monaco.editor {
* Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.
*/
inlineCompletionsAccessibilityVerbose?: boolean;
/**
* Controls whether paste in overtype mode should overwrite or insert.
*/
overtypeOnPaste?: boolean;
}

export interface IDiffEditorBaseOptions {
Expand Down Expand Up @@ -4913,62 +4913,62 @@ declare namespace monaco.editor {
cursorBlinking = 26,
cursorSmoothCaretAnimation = 27,
cursorStyle = 28,
overtypeCursorStyle = 29,
cursorSurroundingLines = 30,
cursorSurroundingLinesStyle = 31,
cursorWidth = 32,
disableLayerHinting = 33,
disableMonospaceOptimizations = 34,
domReadOnly = 35,
dragAndDrop = 36,
dropIntoEditor = 37,
experimentalEditContextEnabled = 38,
emptySelectionClipboard = 39,
experimentalGpuAcceleration = 40,
experimentalWhitespaceRendering = 41,
extraEditorClassName = 42,
fastScrollSensitivity = 43,
find = 44,
fixedOverflowWidgets = 45,
folding = 46,
foldingStrategy = 47,
foldingHighlight = 48,
foldingImportsByDefault = 49,
foldingMaximumRegions = 50,
unfoldOnClickAfterEndOfLine = 51,
fontFamily = 52,
fontInfo = 53,
fontLigatures = 54,
fontSize = 55,
fontWeight = 56,
fontVariations = 57,
formatOnPaste = 58,
formatOnType = 59,
glyphMargin = 60,
gotoLocation = 61,
hideCursorInOverviewRuler = 62,
hover = 63,
inDiffEditor = 64,
inlineSuggest = 65,
letterSpacing = 66,
lightbulb = 67,
lineDecorationsWidth = 68,
lineHeight = 69,
lineNumbers = 70,
lineNumbersMinChars = 71,
linkedEditing = 72,
links = 73,
matchBrackets = 74,
minimap = 75,
mouseStyle = 76,
mouseWheelScrollSensitivity = 77,
mouseWheelZoom = 78,
multiCursorMergeOverlapping = 79,
multiCursorModifier = 80,
multiCursorPaste = 81,
multiCursorLimit = 82,
occurrencesHighlight = 83,
occurrencesHighlightDelay = 84,
cursorSurroundingLines = 29,
cursorSurroundingLinesStyle = 30,
cursorWidth = 31,
disableLayerHinting = 32,
disableMonospaceOptimizations = 33,
domReadOnly = 34,
dragAndDrop = 35,
dropIntoEditor = 36,
experimentalEditContextEnabled = 37,
emptySelectionClipboard = 38,
experimentalGpuAcceleration = 39,
experimentalWhitespaceRendering = 40,
extraEditorClassName = 41,
fastScrollSensitivity = 42,
find = 43,
fixedOverflowWidgets = 44,
folding = 45,
foldingStrategy = 46,
foldingHighlight = 47,
foldingImportsByDefault = 48,
foldingMaximumRegions = 49,
unfoldOnClickAfterEndOfLine = 50,
fontFamily = 51,
fontInfo = 52,
fontLigatures = 53,
fontSize = 54,
fontWeight = 55,
fontVariations = 56,
formatOnPaste = 57,
formatOnType = 58,
glyphMargin = 59,
gotoLocation = 60,
hideCursorInOverviewRuler = 61,
hover = 62,
inDiffEditor = 63,
inlineSuggest = 64,
letterSpacing = 65,
lightbulb = 66,
lineDecorationsWidth = 67,
lineHeight = 68,
lineNumbers = 69,
lineNumbersMinChars = 70,
linkedEditing = 71,
links = 72,
matchBrackets = 73,
minimap = 74,
mouseStyle = 75,
mouseWheelScrollSensitivity = 76,
mouseWheelZoom = 77,
multiCursorMergeOverlapping = 78,
multiCursorModifier = 79,
multiCursorPaste = 80,
multiCursorLimit = 81,
occurrencesHighlight = 82,
occurrencesHighlightDelay = 83,
overtypeCursorStyle = 84,
overtypeOnPaste = 85,
overviewRulerBorder = 86,
overviewRulerLanes = 87,
Expand Down

0 comments on commit 2ecbd60

Please sign in to comment.