mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2026-02-04 14:22:24 +00:00
mc version of mark-previous-like-this
This commit is contained in:
@@ -39,3 +39,43 @@ Feature: Marking multiple parts of the buffer
|
||||
And I press "C-- M->"
|
||||
And I type "more"
|
||||
Then I should see "Here's more, more and text"
|
||||
|
||||
Scenario: Marking prev like this, cursors
|
||||
When I insert "This text has the word text in it"
|
||||
And I select the last "text"
|
||||
And I press "M-<"
|
||||
Then I should have 2 cursors
|
||||
|
||||
Scenario: Marking prev like this, region
|
||||
Given I turn on delete-selection-mode
|
||||
When I insert "This text has the word text in it"
|
||||
And I select the last "text"
|
||||
And I press "M-<"
|
||||
And I type "sentence"
|
||||
Then I should see "This sentence has the word sentence in it"
|
||||
|
||||
Scenario: Skipping a prev mark
|
||||
Given I turn on delete-selection-mode
|
||||
When I insert "Here's text, text and text"
|
||||
And I select the last "text"
|
||||
And I press "M-<"
|
||||
And I press "C-0 M-<"
|
||||
And I type "more"
|
||||
Then I should see "Here's more, text and more"
|
||||
|
||||
Scenario: Removing first fake
|
||||
When I insert "Here's text, text and text"
|
||||
And I select the last "text"
|
||||
And I press "M-<"
|
||||
And I press "C-- M-<"
|
||||
Then I should have one cursor
|
||||
|
||||
Scenario: Removing first mark
|
||||
Given I turn on delete-selection-mode
|
||||
When I insert "Here's text, text and text"
|
||||
And I select the last "text"
|
||||
And I press "M-<"
|
||||
And I press "M-<"
|
||||
And I press "C-- M-<"
|
||||
And I type "more"
|
||||
Then I should see "Here's text, more and more"
|
||||
|
||||
@@ -82,3 +82,11 @@
|
||||
(message "Can not go to character '%s' since it does not exist in the current buffer: %s"))
|
||||
(assert search nil message word (espuds-buffer-contents))
|
||||
(if (string-equal "front" pos) (backward-word)))))
|
||||
|
||||
(When "^I select the last \"\\(.+\\)\"$"
|
||||
(lambda (text)
|
||||
(goto-char (point-max))
|
||||
(let ((search (re-search-backward text nil t)))
|
||||
(assert search nil "The text '%s' was not found in the current buffer." text))
|
||||
(set-mark (point))
|
||||
(re-search-forward text)))
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
(mm/clear-all)
|
||||
(global-set-key (kbd "C->") 'mark-next-like-this)
|
||||
(global-set-key (kbd "M->") 'mc/mark-next-like-this)
|
||||
(global-set-key (kbd "M-<") 'mc/mark-previous-like-this)
|
||||
(global-set-key (kbd "H-SPC") 'set-rectangular-region-anchor)
|
||||
(switch-to-buffer
|
||||
(get-buffer-create "*multiple-cursors*"))
|
||||
|
||||
Reference in New Issue
Block a user