diff --git a/src/vs/base/browser/browser.ts b/src/vs/base/browser/browser.ts
index ed183b57cb9d08892024cfa6a5dc39d16c0c05bc..39e20a28dd9f4501a0f12aa59199bb5d91c9e317 100644
--- a/src/vs/base/browser/browser.ts
+++ b/src/vs/base/browser/browser.ts
@@ -153,8 +153,6 @@ export function canUseTranslate3d(): boolean {
return true;
}
-export const enableEmptySelectionClipboard = isWebKit;
-
export function supportsExecCommand(command: string): boolean {
return (
(isIE || Platform.isNative)
diff --git a/src/vs/editor/browser/config/configuration.ts b/src/vs/editor/browser/config/configuration.ts
index 73a05a745c1ec4dbe479963907cc41dd938601f2..86fe73ad6decda69754da343fde4919f718388ab 100644
--- a/src/vs/editor/browser/config/configuration.ts
+++ b/src/vs/editor/browser/config/configuration.ts
@@ -351,6 +351,7 @@ export class Configuration extends CommonEditorConfiguration {
outerWidth: this._elementSizeObserver.getWidth(),
outerHeight: this._elementSizeObserver.getHeight(),
canUseTranslate3d: browser.canUseTranslate3d(),
+ emptySelectionClipboard: browser.isWebKit,
pixelRatio: browser.getPixelRatio(),
zoomLevel: browser.getZoomLevel()
};
diff --git a/src/vs/editor/browser/controller/textAreaHandler.ts b/src/vs/editor/browser/controller/textAreaHandler.ts
index f56d75f5b8e9b894944753f959454ca05d16a800..247fddd15e0913adb499a8784996ee997e0f04fe 100644
--- a/src/vs/editor/browser/controller/textAreaHandler.ts
+++ b/src/vs/editor/browser/controller/textAreaHandler.ts
@@ -63,6 +63,7 @@ export class TextAreaHandler extends ViewPart {
private _experimentalScreenReader: boolean;
private _fontInfo: BareFontInfo;
private _lineHeight: number;
+ private _emptySelectionClipboard: boolean;
/**
* Defined only when the text area is visible (composition case).
@@ -93,6 +94,7 @@ export class TextAreaHandler extends ViewPart {
this._experimentalScreenReader = conf.viewInfo.experimentalScreenReader;
this._fontInfo = conf.fontInfo;
this._lineHeight = conf.lineHeight;
+ this._emptySelectionClipboard = conf.emptySelectionClipboard;
this._visibleTextArea = null;
this._selections = [new Selection(1, 1, 1, 1)];
@@ -130,9 +132,9 @@ export class TextAreaHandler extends ViewPart {
const textAreaInputHost: ITextAreaInputHost = {
getPlainTextToCopy: (): string => {
- const whatToCopy = this._context.model.getPlainTextToCopy(this._selections, browser.enableEmptySelectionClipboard);
+ const whatToCopy = this._context.model.getPlainTextToCopy(this._selections, this._emptySelectionClipboard);
- if (browser.enableEmptySelectionClipboard) {
+ if (this._emptySelectionClipboard) {
if (browser.isFirefox) {
// When writing "LINE\r\n" to the clipboard and then pasting,
// Firefox pastes "LINE\n", so let's work around this quirk
@@ -149,7 +151,7 @@ export class TextAreaHandler extends ViewPart {
},
getHTMLToCopy: (): string => {
- return this._context.model.getHTMLToCopy(this._selections, browser.enableEmptySelectionClipboard);
+ return this._context.model.getHTMLToCopy(this._selections, this._emptySelectionClipboard);
},
getScreenReaderContent: (currentState: TextAreaState): TextAreaState => {
@@ -181,7 +183,7 @@ export class TextAreaHandler extends ViewPart {
this._register(this._textAreaInput.onPaste((e: IPasteData) => {
let pasteOnNewLine = false;
- if (browser.enableEmptySelectionClipboard) {
+ if (this._emptySelectionClipboard) {
pasteOnNewLine = (e.text === this._lastCopiedValue && this._lastCopiedValueIsFromEmptySelection);
}
this._viewController.paste('keyboard', e.text, pasteOnNewLine);
@@ -285,6 +287,9 @@ export class TextAreaHandler extends ViewPart {
if (e.pixelRatio) {
this._pixelRatio = conf.pixelRatio;
}
+ if (e.emptySelectionClipboard) {
+ this._emptySelectionClipboard = conf.emptySelectionClipboard;
+ }
return true;
}
diff --git a/src/vs/editor/browser/widget/codeEditorWidget.ts b/src/vs/editor/browser/widget/codeEditorWidget.ts
index 29d8baf1cad87adaa00a09c7b47656b96901e773..a7de1e2bac1b4d395a1095bdf8131e168ae61731 100644
--- a/src/vs/editor/browser/widget/codeEditorWidget.ts
+++ b/src/vs/editor/browser/widget/codeEditorWidget.ts
@@ -9,7 +9,6 @@ import 'vs/editor/common/view/editorColorRegistry'; // initialze editor theming
import 'vs/css!./media/tokens';
import { onUnexpectedError } from 'vs/base/common/errors';
import { TPromise } from 'vs/base/common/winjs.base';
-import * as browser from 'vs/base/browser/browser';
import * as dom from 'vs/base/browser/dom';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { ICommandService } from 'vs/platform/commands/common/commands';
@@ -415,10 +414,6 @@ export abstract class CodeEditorWidget extends CommonCodeEditor implements edito
}
}
- protected _enableEmptySelectionClipboard(): boolean {
- return browser.enableEmptySelectionClipboard;
- }
-
protected _createView(): void {
this._view = new View(
this._commandService,
diff --git a/src/vs/editor/common/commonCodeEditor.ts b/src/vs/editor/common/commonCodeEditor.ts
index 2b9facec788366eac2059d1e348c5d3806706ef7..d698e6a2f0ce83ab819f8450ba669c24d128a968 100644
--- a/src/vs/editor/common/commonCodeEditor.ts
+++ b/src/vs/editor/common/commonCodeEditor.ts
@@ -902,8 +902,7 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo
this.cursor = new Cursor(
this._configuration,
this.model,
- viewModelHelper,
- this._enableEmptySelectionClipboard()
+ viewModelHelper
);
this.viewCursor = new ViewModelCursors(
@@ -938,8 +937,6 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo
}
}
- protected abstract _enableEmptySelectionClipboard(): boolean;
-
protected abstract _createView(): void;
protected _postDetachModelCleanup(detachedModel: editorCommon.IModel): void {
diff --git a/src/vs/editor/common/config/commonEditorConfig.ts b/src/vs/editor/common/config/commonEditorConfig.ts
index 2c7aacd044a7cb32b3769d65d380d0fb46a34513..f1830ec4f7800f1f75a062262883380fbc57519a 100644
--- a/src/vs/editor/common/config/commonEditorConfig.ts
+++ b/src/vs/editor/common/config/commonEditorConfig.ts
@@ -56,6 +56,7 @@ export interface IEnvConfiguration {
outerWidth: number;
outerHeight: number;
canUseTranslate3d: boolean;
+ emptySelectionClipboard: boolean;
pixelRatio: number;
zoomLevel: number;
}
@@ -119,6 +120,7 @@ export abstract class CommonEditorConfiguration extends Disposable implements ed
isDominatedByLongLines: this._isDominatedByLongLines,
lineNumbersDigitCount: this._lineNumbersDigitCount,
canUseTranslate3d: partialEnv.canUseTranslate3d,
+ emptySelectionClipboard: partialEnv.emptySelectionClipboard,
pixelRatio: partialEnv.pixelRatio,
tabFocusMode: TabFocus.getTabFocusMode()
};
diff --git a/src/vs/editor/common/config/editorOptions.ts b/src/vs/editor/common/config/editorOptions.ts
index 529555dbab55c905ad4e8010effd47137b6bae71..5c43033f67aba5263b8bc9c2fb0a0ed3611148c5 100644
--- a/src/vs/editor/common/config/editorOptions.ts
+++ b/src/vs/editor/common/config/editorOptions.ts
@@ -1219,6 +1219,7 @@ export interface IEnvironmentalOptions {
readonly isDominatedByLongLines: boolean;
readonly lineNumbersDigitCount: number;
readonly canUseTranslate3d: boolean;
+ readonly emptySelectionClipboard: boolean;
readonly pixelRatio: number;
readonly tabFocusMode: boolean;
}
@@ -1665,7 +1666,7 @@ export class InternalEditorOptionsFactory {
useTabStops: opts.useTabStops,
tabFocusMode: opts.readOnly ? true : env.tabFocusMode,
dragAndDrop: opts.dragAndDrop,
- emptySelectionClipboard: opts.emptySelectionClipboard,
+ emptySelectionClipboard: opts.emptySelectionClipboard && env.emptySelectionClipboard,
layoutInfo: layoutInfo,
fontInfo: env.fontInfo,
viewInfo: opts.viewInfo,
diff --git a/src/vs/editor/common/controller/cursor.ts b/src/vs/editor/common/controller/cursor.ts
index b8a95cf04aee4e709e053c86825ec604d330e973..bc49cef51d3b6ed237819c84ad1e2fb628767fee 100644
--- a/src/vs/editor/common/controller/cursor.ts
+++ b/src/vs/editor/common/controller/cursor.ts
@@ -77,19 +77,16 @@ export class Cursor extends Disposable implements ICursors {
private _isDoingComposition: boolean;
private _columnSelectData: IColumnSelectData;
- private enableEmptySelectionClipboard: boolean;
-
private _handlers: {
[key: string]: (ctx: IMultipleCursorOperationContext) => void;
};
- constructor(configuration: editorCommon.IConfiguration, model: editorCommon.IModel, viewModelHelper: IViewModelHelper, enableEmptySelectionClipboard: boolean) {
+ constructor(configuration: editorCommon.IConfiguration, model: editorCommon.IModel, viewModelHelper: IViewModelHelper) {
super();
this._eventEmitter = this._register(new EventEmitter());
this.configuration = configuration;
this.model = model;
this.viewModelHelper = viewModelHelper;
- this.enableEmptySelectionClipboard = enableEmptySelectionClipboard;
const createCursorContext = () => {
const config = new CursorConfiguration(
@@ -1062,7 +1059,7 @@ export class Cursor extends Disposable implements ICursors {
}
private _cut(ctx: IMultipleCursorOperationContext): void {
- this._applyEdits(ctx, DeleteOperations.cut(this.context.config, this.context.model, this._getAllCursorsModelState(), this.enableEmptySelectionClipboard));
+ this._applyEdits(ctx, DeleteOperations.cut(this.context.config, this.context.model, this._getAllCursorsModelState()));
}
// -------------------- END editing operations
diff --git a/src/vs/editor/common/controller/cursorCommon.ts b/src/vs/editor/common/controller/cursorCommon.ts
index dd98c3479d4eb7f55e38e44f16a9cb0218961587..55e1413e1924946ed06dc74a80a77fd6c2b79abd 100644
--- a/src/vs/editor/common/controller/cursorCommon.ts
+++ b/src/vs/editor/common/controller/cursorCommon.ts
@@ -61,6 +61,7 @@ export class CursorConfiguration {
public readonly lineHeight: number;
public readonly useTabStops: boolean;
public readonly wordSeparators: string;
+ public readonly emptySelectionClipboard: boolean;
public readonly autoClosingBrackets: boolean;
public readonly autoClosingPairsOpen: CharacterMap;
public readonly autoClosingPairsClose: CharacterMap;
@@ -71,6 +72,7 @@ export class CursorConfiguration {
return (
e.layoutInfo
|| e.wordSeparators
+ || e.emptySelectionClipboard
|| e.autoClosingBrackets
|| e.useTabStops
|| e.lineHeight
@@ -94,6 +96,7 @@ export class CursorConfiguration {
this.lineHeight = c.lineHeight;
this.useTabStops = c.useTabStops;
this.wordSeparators = c.wordSeparators;
+ this.emptySelectionClipboard = c.emptySelectionClipboard;
this.autoClosingBrackets = c.autoClosingBrackets;
this.autoClosingPairsOpen = {};
diff --git a/src/vs/editor/common/controller/cursorDeleteOperations.ts b/src/vs/editor/common/controller/cursorDeleteOperations.ts
index ffcfaf8530d90a4c3c343bfcb18aaffdabdc2d38..6996f1af6e686ce29f88723d6625cb23dc84e0e3 100644
--- a/src/vs/editor/common/controller/cursorDeleteOperations.ts
+++ b/src/vs/editor/common/controller/cursorDeleteOperations.ts
@@ -163,14 +163,14 @@ export class DeleteOperations {
});
}
- public static cut(config: CursorConfiguration, model: ICursorSimpleModel, cursors: SingleCursorState[], enableEmptySelectionClipboard: boolean): EditOperationResult {
+ public static cut(config: CursorConfiguration, model: ICursorSimpleModel, cursors: SingleCursorState[]): EditOperationResult {
let commands: CommandResult[] = [];
for (let i = 0, len = cursors.length; i < len; i++) {
const cursor = cursors[i];
let selection = cursor.selection;
if (selection.isEmpty()) {
- if (enableEmptySelectionClipboard) {
+ if (config.emptySelectionClipboard) {
// This is a full line cut
let position = cursor.position;
diff --git a/src/vs/editor/common/view/viewEvents.ts b/src/vs/editor/common/view/viewEvents.ts
index 0f5ee787b72b7d6e8136201d1222ce6cae13e71f..31c994adea80786c4107af4c03e4a367ee480563 100644
--- a/src/vs/editor/common/view/viewEvents.ts
+++ b/src/vs/editor/common/view/viewEvents.ts
@@ -39,6 +39,7 @@ export class ViewConfigurationChangedEvent {
public readonly editorClassName: boolean;
public readonly lineHeight: boolean;
public readonly readOnly: boolean;
+ public readonly emptySelectionClipboard: boolean;
public readonly layoutInfo: boolean;
public readonly fontInfo: boolean;
public readonly viewInfo: boolean;
@@ -50,6 +51,7 @@ export class ViewConfigurationChangedEvent {
this.editorClassName = source.editorClassName;
this.lineHeight = source.lineHeight;
this.readOnly = source.readOnly;
+ this.emptySelectionClipboard = source.emptySelectionClipboard;
this.layoutInfo = source.layoutInfo;
this.fontInfo = source.fontInfo;
this.viewInfo = source.viewInfo;
diff --git a/src/vs/editor/common/viewModel/viewModel.ts b/src/vs/editor/common/viewModel/viewModel.ts
index 7ee4226bfc99e844efb1cd40f92db256c1a62dca..f04c2936c74b9d1a213569aafc4468376b850291 100644
--- a/src/vs/editor/common/viewModel/viewModel.ts
+++ b/src/vs/editor/common/viewModel/viewModel.ts
@@ -137,8 +137,8 @@ export interface IViewModel {
getModelLineMaxColumn(modelLineNumber: number): number;
validateModelPosition(modelPosition: IPosition): Position;
- getPlainTextToCopy(ranges: Range[], enableEmptySelectionClipboard: boolean): string;
- getHTMLToCopy(ranges: Range[], enableEmptySelectionClipboard: boolean): string;
+ getPlainTextToCopy(ranges: Range[], emptySelectionClipboard: boolean): string;
+ getHTMLToCopy(ranges: Range[], emptySelectionClipboard: boolean): string;
}
export class MinimapLinesRenderingData {
diff --git a/src/vs/editor/common/viewModel/viewModelImpl.ts b/src/vs/editor/common/viewModel/viewModelImpl.ts
index c0d92a4010251a68df2e61bafbcd6456e4cb116d..193e852523c624e9cda6588252a130b6977da7ff 100644
--- a/src/vs/editor/common/viewModel/viewModelImpl.ts
+++ b/src/vs/editor/common/viewModel/viewModelImpl.ts
@@ -520,13 +520,13 @@ export class ViewModel extends ViewEventEmitter implements IViewModel {
return this.model.validatePosition(position);
}
- public getPlainTextToCopy(ranges: Range[], enableEmptySelectionClipboard: boolean): string {
+ public getPlainTextToCopy(ranges: Range[], emptySelectionClipboard: boolean): string {
let newLineCharacter = this.model.getEOL();
if (ranges.length === 1) {
let range: Range = ranges[0];
if (range.isEmpty()) {
- if (enableEmptySelectionClipboard) {
+ if (emptySelectionClipboard) {
let modelLineNumber = this.coordinatesConverter.convertViewPositionToModelPosition(new Position(range.startLineNumber, 1)).lineNumber;
return this.model.getLineContent(modelLineNumber) + newLineCharacter;
} else {
@@ -546,7 +546,7 @@ export class ViewModel extends ViewEventEmitter implements IViewModel {
}
}
- public getHTMLToCopy(viewRanges: Range[], enableEmptySelectionClipboard: boolean): string {
+ public getHTMLToCopy(viewRanges: Range[], emptySelectionClipboard: boolean): string {
if (this.model.getLanguageIdentifier().id === LanguageId.PlainText) {
return null;
}
@@ -558,7 +558,7 @@ export class ViewModel extends ViewEventEmitter implements IViewModel {
let range = this.coordinatesConverter.convertViewRangeToModelRange(viewRanges[0]);
if (range.isEmpty()) {
- if (!enableEmptySelectionClipboard) {
+ if (!emptySelectionClipboard) {
// nothing to copy
return null;
}
diff --git a/src/vs/editor/contrib/clipboard/browser/clipboard.ts b/src/vs/editor/contrib/clipboard/browser/clipboard.ts
index 5dc8118dfe397ab473df49fa3d71f4e30bfb3f05..9ef4294f72884836ed689c6a0ad973d37f9fbff6 100644
--- a/src/vs/editor/contrib/clipboard/browser/clipboard.ts
+++ b/src/vs/editor/contrib/clipboard/browser/clipboard.ts
@@ -81,9 +81,9 @@ class ExecCommandCutAction extends ExecCommandAction {
}
public run(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor): void {
- var enableEmptySelectionClipboard = editor.getConfiguration().emptySelectionClipboard && browser.enableEmptySelectionClipboard;
+ const emptySelectionClipboard = editor.getConfiguration().emptySelectionClipboard;
- if (!enableEmptySelectionClipboard && editor.getSelection().isEmpty()) {
+ if (!emptySelectionClipboard && editor.getSelection().isEmpty()) {
return;
}
@@ -113,9 +113,9 @@ class ExecCommandCopyAction extends ExecCommandAction {
}
public run(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor): void {
- var enableEmptySelectionClipboard = editor.getConfiguration().emptySelectionClipboard && browser.enableEmptySelectionClipboard;
+ const emptySelectionClipboard = editor.getConfiguration().emptySelectionClipboard;
- if (!enableEmptySelectionClipboard && editor.getSelection().isEmpty()) {
+ if (!emptySelectionClipboard && editor.getSelection().isEmpty()) {
return;
}
@@ -162,9 +162,9 @@ class ExecCommandCopyWithSyntaxHighlightingAction extends ExecCommandAction {
}
public run(accessor: ServicesAccessor, editor: editorCommon.ICommonCodeEditor): void {
- var enableEmptySelectionClipboard = editor.getConfiguration().emptySelectionClipboard && browser.enableEmptySelectionClipboard;
+ const emptySelectionClipboard = editor.getConfiguration().emptySelectionClipboard;
- if (!enableEmptySelectionClipboard && editor.getSelection().isEmpty()) {
+ if (!emptySelectionClipboard && editor.getSelection().isEmpty()) {
return;
}
diff --git a/src/vs/editor/test/common/commands/commandTestUtils.ts b/src/vs/editor/test/common/commands/commandTestUtils.ts
index 1e9c6202c59cb44114367388c0678763ce3fe8ff..3db5dc1fd3c063c880a121bc91536033f77d5ab2 100644
--- a/src/vs/editor/test/common/commands/commandTestUtils.ts
+++ b/src/vs/editor/test/common/commands/commandTestUtils.ts
@@ -25,7 +25,7 @@ export function testCommand(
let model = Model.createFromString(lines.join('\n'), undefined, languageIdentifier);
let config = new TestConfiguration(null);
- let cursor = new Cursor(config, model, viewModelHelper(model), false);
+ let cursor = new Cursor(config, model, viewModelHelper(model));
cursor.setSelections('tests', [selection]);
diff --git a/src/vs/editor/test/common/commands/sideEditing.test.ts b/src/vs/editor/test/common/commands/sideEditing.test.ts
index 7ddf9c917296e3642fe0dba63f976da0818d1fa2..6ccc560d22cee797dbb0c23151cfc5e382eb3c89 100644
--- a/src/vs/editor/test/common/commands/sideEditing.test.ts
+++ b/src/vs/editor/test/common/commands/sideEditing.test.ts
@@ -21,7 +21,7 @@ const NO_TAB_SIZE = 0;
function testCommand(lines: string[], selections: Selection[], edits: IIdentifiedSingleEditOperation[], expectedLines: string[], expectedSelections: Selection[]): void {
let model = Model.createFromString(lines.join('\n'));
let config = new TestConfiguration(null);
- let cursor = new Cursor(config, model, viewModelHelper(model), false);
+ let cursor = new Cursor(config, model, viewModelHelper(model));
cursor.setSelections('tests', selections);
diff --git a/src/vs/editor/test/common/config/commonEditorConfig.test.ts b/src/vs/editor/test/common/config/commonEditorConfig.test.ts
index e98f7cc203c9a2c7a8b3c2cb2e1f3ed7b90a902e..5e6e1dd062a57d016f5d8b18cb6e1c243893ac2a 100644
--- a/src/vs/editor/test/common/config/commonEditorConfig.test.ts
+++ b/src/vs/editor/test/common/config/commonEditorConfig.test.ts
@@ -59,6 +59,7 @@ suite('Common Editor Config', () => {
outerWidth: 1000,
outerHeight: 100,
canUseTranslate3d: true,
+ emptySelectionClipboard: true,
pixelRatio: 1,
zoomLevel: 0
};
diff --git a/src/vs/editor/test/common/controller/cursor.test.ts b/src/vs/editor/test/common/controller/cursor.test.ts
index eb7e5df87c720b5fb1b29784b2c3cf24262ba6f1..37e3426c3c7d0c7e5c24efb7f7a7185ded8143f0 100644
--- a/src/vs/editor/test/common/controller/cursor.test.ts
+++ b/src/vs/editor/test/common/controller/cursor.test.ts
@@ -146,7 +146,7 @@ suite('Editor Controller - Cursor', () => {
thisModel = Model.createFromString(text);
thisConfiguration = new TestConfiguration(null);
- thisCursor = new Cursor(thisConfiguration, thisModel, viewModelHelper(thisModel), false);
+ thisCursor = new Cursor(thisConfiguration, thisModel, viewModelHelper(thisModel));
});
teardown(() => {
@@ -705,7 +705,7 @@ suite('Editor Controller - Cursor', () => {
'\t\t}',
'\t}'
].join('\n'));
- let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model), true);
+ let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model));
moveTo(cursor, 1, 7, false);
assertCursor(cursor, new Position(1, 7));
@@ -739,7 +739,7 @@ suite('Editor Controller - Cursor', () => {
'var concat = require("gulp-concat");',
'var newer = require("gulp-newer");',
].join('\n'));
- let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model), true);
+ let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model));
moveTo(cursor, 1, 4, false);
assertCursor(cursor, new Position(1, 4));
@@ -774,7 +774,7 @@ suite('Editor Controller - Cursor', () => {
'',
'',
].join('\n'));
- let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model), true);
+ let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model));
moveTo(cursor, 10, 10, false);
assertCursor(cursor, new Position(10, 10));
@@ -832,7 +832,7 @@ suite('Editor Controller - Cursor', () => {
'',
'',
].join('\n'));
- let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model), true);
+ let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model));
moveTo(cursor, 10, 10, false);
assertCursor(cursor, new Position(10, 10));
@@ -877,7 +877,7 @@ suite('Editor Controller - Cursor', () => {
'var concat = require("gulp-concat");',
'var newer = require("gulp-newer");',
].join('\n'));
- let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model), true);
+ let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model));
moveTo(cursor, 1, 4, false);
assertCursor(cursor, new Position(1, 4));
@@ -1421,7 +1421,7 @@ suite('Editor Controller - Regression tests', () => {
'qwerty'
];
let model = Model.createFromString(text.join('\n'));
- let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model), true);
+ let cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model));
moveTo(cursor, 2, 1, false);
assertCursor(cursor, new Selection(2, 1, 2, 1));
@@ -1439,7 +1439,7 @@ suite('Editor Controller - Regression tests', () => {
''
];
model = Model.createFromString(text.join('\n'));
- cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model), true);
+ cursor = new Cursor(new TestConfiguration(null), model, viewModelHelper(model));
moveTo(cursor, 2, 1, false);
assertCursor(cursor, new Selection(2, 1, 2, 1));
@@ -2719,7 +2719,7 @@ interface ICursorOpts {
function usingCursor(opts: ICursorOpts, callback: (model: Model, cursor: Cursor) => void): void {
let model = Model.createFromString(opts.text.join('\n'), opts.modelOpts, opts.languageIdentifier);
let config = new TestConfiguration(opts.editorOpts);
- let cursor = new Cursor(config, model, viewModelHelper(model), false);
+ let cursor = new Cursor(config, model, viewModelHelper(model));
callback(model, cursor);
diff --git a/src/vs/editor/test/common/controller/cursorMoveCommand.test.ts b/src/vs/editor/test/common/controller/cursorMoveCommand.test.ts
index c1388ba58e870871917e743ce3d589b0caedc135..5528a35ac24fa3ff7bac40b92b8fcd9425fc7e83 100644
--- a/src/vs/editor/test/common/controller/cursorMoveCommand.test.ts
+++ b/src/vs/editor/test/common/controller/cursorMoveCommand.test.ts
@@ -454,7 +454,7 @@ suite('Cursor move command test', () => {
});
function aCursor(viewModelHelper?: IViewModelHelper): Cursor {
- return new Cursor(thisConfiguration, thisModel, viewModelHelper || aViewModelHelper(thisModel), false);
+ return new Cursor(thisConfiguration, thisModel, viewModelHelper || aViewModelHelper(thisModel));
}
});
diff --git a/src/vs/editor/test/common/mocks/testConfiguration.ts b/src/vs/editor/test/common/mocks/testConfiguration.ts
index 2ace40b73d46a2bb56278e1ae819a32e24c5eb89..9c3fdd69c06002d0f08c64df264ac64dc07f5417 100644
--- a/src/vs/editor/test/common/mocks/testConfiguration.ts
+++ b/src/vs/editor/test/common/mocks/testConfiguration.ts
@@ -21,6 +21,7 @@ export class TestConfiguration extends CommonEditorConfiguration {
outerWidth: 100,
outerHeight: 100,
canUseTranslate3d: true,
+ emptySelectionClipboard: true,
pixelRatio: 1,
zoomLevel: 0
};