提交 4241782c 编写于 作者: R rebornix

Fix #21078. Align drag and drop with other options in the editor

上级 a3be2428
......@@ -440,7 +440,7 @@ class MouseDownOperation extends Disposable {
// Overwrite the detail of the MouseEvent, as it will be sent out in an event and contributions might rely on it.
e.detail = this._mouseState.count;
if (this._context.configuration.editor.enableDragAndDrop
if (this._context.configuration.editor.dragAndDrop
&& !this._mouseState.altKey // we don't support multiple mouse
&& e.detail < 2 // only single click on a selection can work
&& !this._isActive // the mouse is not down yet
......
......@@ -317,7 +317,7 @@ class InternalEditorOptionsHelper {
autoClosingBrackets: toBoolean(opts.autoClosingBrackets),
useTabStops: toBoolean(opts.useTabStops),
tabFocusMode: tabFocusMode,
enableDragAndDrop: toBoolean(opts.enableDragAndDrop),
dragAndDrop: toBoolean(opts.dragAndDrop),
layoutInfo: layoutInfo,
fontInfo: fontInfo,
viewInfo: viewInfo,
......@@ -853,10 +853,10 @@ const editorConfiguration: IConfigurationNode = {
'default': false,
'description': nls.localize('stablePeek', "Keep peek editors open even when double clicking their content or when hitting Escape.")
},
'editor.enableDragAndDrop': {
'editor.dragAndDrop': {
'type': 'boolean',
'default': DefaultConfig.editor.enableDragAndDrop,
'description': nls.localize('enableDragAndDrop', "Controls if the editor should allow to move selections via drag and drop.")
'default': DefaultConfig.editor.dragAndDrop,
'description': nls.localize('dragAndDrop', "Controls if the editor should allow to move selections via drag and drop.")
},
'diffEditor.renderSideBySide': {
'type': 'boolean',
......
......@@ -106,7 +106,7 @@ class ConfigClass implements IConfiguration {
renderLineHighlight: 'line',
useTabStops: true,
matchBrackets: true,
enableDragAndDrop: false,
dragAndDrop: false,
fontFamily: (
platform.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isLinux ? DEFAULT_LINUX_FONT_FAMILY : DEFAULT_WINDOWS_FONT_FAMILY)
......
......@@ -423,7 +423,7 @@ export interface IEditorOptions {
* Controls if the editor should allow to move selections via drag and drop.
* Defaults to false.
*/
enableDragAndDrop?: boolean;
dragAndDrop?: boolean;
/**
* Enable the suggestion box to pop-up on trigger characters.
* Defaults to true.
......@@ -1073,7 +1073,7 @@ export class InternalEditorOptions {
readonly autoClosingBrackets: boolean;
readonly useTabStops: boolean;
readonly tabFocusMode: boolean;
readonly enableDragAndDrop: boolean;
readonly dragAndDrop: boolean;
// ---- grouped options
readonly layoutInfo: EditorLayoutInfo;
readonly fontInfo: FontInfo;
......@@ -1091,7 +1091,7 @@ export class InternalEditorOptions {
autoClosingBrackets: boolean;
useTabStops: boolean;
tabFocusMode: boolean;
enableDragAndDrop: boolean;
dragAndDrop: boolean;
layoutInfo: EditorLayoutInfo;
fontInfo: FontInfo;
viewInfo: InternalEditorViewOptions;
......@@ -1104,7 +1104,7 @@ export class InternalEditorOptions {
this.autoClosingBrackets = Boolean(source.autoClosingBrackets);
this.useTabStops = Boolean(source.useTabStops);
this.tabFocusMode = Boolean(source.tabFocusMode);
this.enableDragAndDrop = Boolean(source.enableDragAndDrop);
this.dragAndDrop = Boolean(source.dragAndDrop);
this.layoutInfo = source.layoutInfo.clone();
this.fontInfo = source.fontInfo.clone();
this.viewInfo = source.viewInfo.clone();
......@@ -1123,7 +1123,7 @@ export class InternalEditorOptions {
&& this.autoClosingBrackets === other.autoClosingBrackets
&& this.useTabStops === other.useTabStops
&& this.tabFocusMode === other.tabFocusMode
&& this.enableDragAndDrop === other.enableDragAndDrop
&& this.dragAndDrop === other.dragAndDrop
&& this.layoutInfo.equals(other.layoutInfo)
&& this.fontInfo.equals(other.fontInfo)
&& this.viewInfo.equals(other.viewInfo)
......@@ -1143,7 +1143,7 @@ export class InternalEditorOptions {
autoClosingBrackets: (this.autoClosingBrackets !== newOpts.autoClosingBrackets),
useTabStops: (this.useTabStops !== newOpts.useTabStops),
tabFocusMode: (this.tabFocusMode !== newOpts.tabFocusMode),
enableDragAndDrop: (this.enableDragAndDrop !== newOpts.enableDragAndDrop),
dragAndDrop: (this.dragAndDrop !== newOpts.dragAndDrop),
layoutInfo: (!this.layoutInfo.equals(newOpts.layoutInfo)),
fontInfo: (!this.fontInfo.equals(newOpts.fontInfo)),
viewInfo: this.viewInfo.createChangeEvent(newOpts.viewInfo),
......@@ -1170,7 +1170,7 @@ export interface IConfigurationChangedEvent {
readonly autoClosingBrackets: boolean;
readonly useTabStops: boolean;
readonly tabFocusMode: boolean;
readonly enableDragAndDrop: boolean;
readonly dragAndDrop: boolean;
readonly layoutInfo: boolean;
readonly fontInfo: boolean;
readonly viewInfo: IViewConfigurationChangedEvent;
......
......@@ -1604,7 +1604,7 @@ declare module monaco.editor {
readonly autoClosingBrackets: boolean;
readonly useTabStops: boolean;
readonly tabFocusMode: boolean;
readonly enableDragAndDrop: boolean;
readonly dragAndDrop: boolean;
readonly layoutInfo: EditorLayoutInfo;
readonly fontInfo: FontInfo;
readonly viewInfo: InternalEditorViewOptions;
......
......@@ -216,7 +216,7 @@ const configurationValueWhitelist = [
'editor.formatOnType',
'editor.formatOnSave',
'editor.formatOnPaste',
'editor.enableDragAndDrop',
'editor.dragAndDrop',
'window.openFilesInNewWindow',
'javascript.validate.enable',
'editor.mouseWheelZoom',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册