提交 816489da 编写于 作者: J Johannes Rieken

use one style for unexpected outcome, disable by default, #85376

上级 26ef4cfb
......@@ -2395,7 +2395,7 @@ export interface ISuggestOptions {
*/
insertMode?: 'insert' | 'replace';
/**
* Show a highlight when suggestion replaces or keep text after the cursor. Defaults to true.
* Show a highlight when suggestion replaces or keep text after the cursor. Defaults to false.
*/
insertHighlight?: boolean;
/**
......@@ -2531,7 +2531,7 @@ class EditorSuggest extends BaseEditorOption<EditorOption.suggest, InternalSugge
constructor() {
const defaults: InternalSuggestOptions = {
insertMode: 'insert',
insertHighlight: true,
insertHighlight: false,
filterGraceful: true,
snippetsPreventQuickSuggestions: true,
localityBonus: false,
......
......@@ -280,10 +280,7 @@
/* replace/insert decorations */
.monaco-editor .suggest-insertMode-goes {
text-decoration-line: line-through;
}
.monaco-editor .suggest-insertMode-stays {
.monaco-editor .suggest-insert-unexpected {
font-style: italic;
}
......@@ -74,7 +74,7 @@ export class SuggestRangeHighlighter {
// wants inserts but got replace-mode -> highlight AFTER range
newDeco = [{
range: new Range(position.lineNumber, position.column, position.lineNumber, position.column + info.overwriteAfter),
options: { inlineClassName: 'suggest-insertMode-goes' }
options: { inlineClassName: 'suggest-insert-unexpected' }
}];
} else if (opts.insertMode === 'replace' && info.overwriteAfter === 0) {
......@@ -83,7 +83,7 @@ export class SuggestRangeHighlighter {
if (wordInfo && wordInfo.endColumn > position.column) {
newDeco = [{
range: new Range(position.lineNumber, position.column, position.lineNumber, wordInfo.endColumn),
options: { inlineClassName: 'suggest-insertMode-stays' }
options: { inlineClassName: 'suggest-insert-unexpected' }
}];
}
}
......
......@@ -3400,7 +3400,7 @@ declare namespace monaco.editor {
*/
insertMode?: 'insert' | 'replace';
/**
* Show a highlight when suggestion replaces or keep text after the cursor. Defaults to true.
* Show a highlight when suggestion replaces or keep text after the cursor. Defaults to false.
*/
insertHighlight?: boolean;
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册