Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

fix multi cursor correct setting #20804

Merged
merged 1 commit into from
Jun 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions spec/text-editor-component-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4221,7 +4221,7 @@ describe('TextEditorComponent', () => {
});

it('adds or removes cursors when holding cmd or ctrl when single-clicking', () => {
atom.config.set('core.editor.multiCursorOnClick', true);
atom.config.set('editor.multiCursorOnClick', true);
const { component, editor } = buildComponent({ platform: 'darwin' });
expect(editor.getCursorScreenPositions()).toEqual([[0, 0]]);

Expand Down Expand Up @@ -4302,7 +4302,7 @@ describe('TextEditorComponent', () => {
});

it('adds word selections when holding cmd or ctrl when double-clicking', () => {
atom.config.set('core.editor.multiCursorOnClick', true);
atom.config.set('editor.multiCursorOnClick', true);
const { component, editor } = buildComponent();
editor.addCursorAtScreenPosition([1, 16], { autoscroll: false });
expect(editor.getCursorScreenPositions()).toEqual([[0, 0], [1, 16]]);
Expand All @@ -4329,7 +4329,7 @@ describe('TextEditorComponent', () => {
});

it('adds line selections when holding cmd or ctrl when triple-clicking', () => {
atom.config.set('core.editor.multiCursorOnClick', true);
atom.config.set('editor.multiCursorOnClick', true);
const { component, editor } = buildComponent();
editor.addCursorAtScreenPosition([1, 16], { autoscroll: false });
expect(editor.getCursorScreenPositions()).toEqual([[0, 0], [1, 16]]);
Expand Down Expand Up @@ -4369,7 +4369,7 @@ describe('TextEditorComponent', () => {
});

it('does not add cursors when holding cmd or ctrl when single-clicking', () => {
atom.config.set('core.editor.multiCursorOnClick', false);
atom.config.set('editor.multiCursorOnClick', false);
const { component, editor } = buildComponent({ platform: 'darwin' });
expect(editor.getCursorScreenPositions()).toEqual([[0, 0]]);

Expand Down Expand Up @@ -4411,7 +4411,7 @@ describe('TextEditorComponent', () => {
});

it('does not add word selections when holding cmd or ctrl when double-clicking', () => {
atom.config.set('core.editor.multiCursorOnClick', false);
atom.config.set('editor.multiCursorOnClick', false);
const { component, editor } = buildComponent();

component.didMouseDownOnContent(
Expand All @@ -4435,7 +4435,7 @@ describe('TextEditorComponent', () => {
});

it('does not add line selections when holding cmd or ctrl when triple-clicking', () => {
atom.config.set('core.editor.multiCursorOnClick', false);
atom.config.set('editor.multiCursorOnClick', false);
const { component, editor } = buildComponent();

const { clientX, clientY } = clientPositionForCharacter(
Expand Down Expand Up @@ -4557,7 +4557,7 @@ describe('TextEditorComponent', () => {
});

it('expands the last selection on drag', () => {
atom.config.set('core.editor.multiCursorOnClick', true);
atom.config.set('editor.multiCursorOnClick', true);
const { component, editor } = buildComponent();
spyOn(component, 'handleMouseDragUntilMouseUp');

Expand Down
2 changes: 1 addition & 1 deletion src/text-editor-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -1994,7 +1994,7 @@ module.exports = class TextEditorComponent {
return;
}

const allowMultiCursor = atom.config.get('core.editor.multiCursorOnClick');
const allowMultiCursor = atom.config.get('editor.multiCursorOnClick');
const addOrRemoveSelection =
allowMultiCursor && (metaKey || (ctrlKey && platform !== 'darwin'));

Expand Down