提交 599727bf 编写于 作者: A Alex Dima

Fixes #2417: All read only editors enter `tabFocusMode` automatically

上级 ae17b9ca
......@@ -776,7 +776,6 @@ export class DiffEditorWidget extends EventEmitter.EventEmitter implements Edito
var clonedOptions:EditorCommon.IDiffEditorOptions = Objects.clone(options || {});
clonedOptions.wrappingColumn = -1;
clonedOptions.readOnly = true;
clonedOptions.tabFocusMode = true;
clonedOptions.automaticLayout = false;
clonedOptions.scrollbar = clonedOptions.scrollbar || {};
clonedOptions.scrollbar.vertical = 'visible';
......
......@@ -131,6 +131,13 @@ class InternalEditorOptionsHelper {
};
}
let readOnly = toBoolean(opts.readOnly);
let tabFocusMode = toBoolean(opts.tabFocusMode);
if (readOnly) {
tabFocusMode = true;
}
return {
// ---- Options that are transparent - get no massaging
lineNumbers: lineNumbers,
......@@ -139,7 +146,7 @@ class InternalEditorOptionsHelper {
revealHorizontalRightPadding: toInteger(opts.revealHorizontalRightPadding, 0),
roundedSelection: toBoolean(opts.roundedSelection),
theme: opts.theme,
readOnly: toBoolean(opts.readOnly),
readOnly: readOnly,
scrollbar: scrollbar,
overviewRulerLanes: toInteger(opts.overviewRulerLanes, 0, 3),
cursorBlinking: opts.cursorBlinking,
......@@ -152,7 +159,7 @@ class InternalEditorOptionsHelper {
wordWrapBreakBeforeCharacters: opts.wordWrapBreakBeforeCharacters,
wordWrapBreakAfterCharacters: opts.wordWrapBreakAfterCharacters,
wordWrapBreakObtrusiveCharacters: opts.wordWrapBreakObtrusiveCharacters,
tabFocusMode: toBoolean(opts.tabFocusMode),
tabFocusMode: tabFocusMode,
stopLineTokenizationAfter: stopLineTokenizationAfter,
stopRenderingLineAfter: stopRenderingLineAfter,
longLineBoundary: toInteger(opts.longLineBoundary),
......
......@@ -136,7 +136,6 @@ export class StringEditor extends BaseTextEditor {
let isReadonly = !isUntitled; // all string editors are readonly except for the untitled one
options.readOnly = isReadonly;
options.tabFocusMode = isReadonly;
return options;
}
......
......@@ -209,7 +209,6 @@ export class TextDiffEditor extends BaseTextEditor {
let readOnly = modifiedInput instanceof StringEditorInput || modifiedInput instanceof ResourceEditorInput;
options.readOnly = readOnly;
options.tabFocusMode = readOnly;
}
return options;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册