Add function to disable mc undo into undo-list.

When user enables mc mode we need to add function to disable mc mode
into undo-list. When users starts to hit 'undo' at some point mc-mode
will be disabled.
This commit is contained in:
Aleksei 2014-12-23 00:26:21 +03:00
parent 82586a0f66
commit ff0ac1fc75
2 changed files with 13 additions and 0 deletions

View File

@ -73,6 +73,18 @@ Feature: Multiple cursors core
And I type "!"
Then I should see "This !text contains the word !text twice"
Scenario: Undo until mc mode will be disabled
Given I have cursors at "text" in "This text contains the word text twice"
And I should have 2 cursors
When I press "C-g"
And I should have 1 cursors
And I press "C-_"
And I should have 2 cursors
And I press "C-_"
And I should have 1 cursors
And I type "!"
Then I should see "This !text contains the word text twice"
Scenario: Setting and popping mark
Given I have cursors at "text" in "This text contains the word text twice"
And I press "C-SPC"

View File

@ -505,6 +505,7 @@ They are temporarily disabled when multiple-cursors are active.")
(if multiple-cursors-mode
(progn
(mc/temporarily-disable-unsupported-minor-modes)
(push `(apply multiple-cursors-mode . ,(list 0)) buffer-undo-list)
(add-hook 'pre-command-hook 'mc/make-a-note-of-the-command-being-run nil t)
(add-hook 'post-command-hook 'mc/execute-this-command-for-all-cursors t t)
(run-hooks 'multiple-cursors-mode-enabled-hook))