Updated tests, README.

This commit is contained in:
Andrea Orru 2016-07-17 15:12:47 +02:00
parent 21e48250ec
commit 67d6579eab
4 changed files with 32 additions and 0 deletions

View File

@ -57,6 +57,8 @@ You can [watch an intro to multiple-cursors at Emacs Rocks](http://emacsrocks.co
- `mc/mark-next-word-like-this`: Like `mc/mark-next-like-this` but only for whole words. - `mc/mark-next-word-like-this`: Like `mc/mark-next-like-this` but only for whole words.
- `mc/mark-next-symbol-like-this`: Like `mc/mark-next-like-this` but only for whole symbols. - `mc/mark-next-symbol-like-this`: Like `mc/mark-next-like-this` but only for whole symbols.
- `mc/mark-previous-like-this`: Adds a cursor and region at the next part of the buffer backwards that matches the current region. - `mc/mark-previous-like-this`: Adds a cursor and region at the next part of the buffer backwards that matches the current region.
- `mc/mark-previous-like-this-word`: Adds a cursor and region at the next part of the buffer backwards that matches the current region, if no region is selected it selects the word at the point.
- `mc/mark-previous-like-this-symbol`: Adds a cursor and region at the next part of the buffer backwards that matches the current region, if no region is selected it selects the symbol at the point.
- `mc/mark-previous-word-like-this`: Like `mc/mark-previous-like-this` but only for whole words. - `mc/mark-previous-word-like-this`: Like `mc/mark-previous-like-this` but only for whole words.
- `mc/mark-previous-symbol-like-this`: Like `mc/mark-previous-like-this` but only for whole symbols. - `mc/mark-previous-symbol-like-this`: Like `mc/mark-previous-like-this` but only for whole symbols.
- `mc/mark-more-like-this-extended`: Use arrow keys to quickly mark/skip next/previous occurances. - `mc/mark-more-like-this-extended`: Use arrow keys to quickly mark/skip next/previous occurances.

View File

@ -14,6 +14,14 @@ Feature: Marking multiple parts of the buffer
And I type "sentence" And I type "sentence"
Then I should see "This sentence has the word sentence in it" Then I should see "This sentence has the word sentence in it"
Scenario: Marking next like this, word
Given I turn on delete-selection-mode
When I insert "This text has the word text in it"
And I go to word "text"
And I press "C-S-c C->"
And I type "sentence"
Then I should see "This sentence has the word sentence in it"
Scenario: Skipping a mark Scenario: Skipping a mark
Given I turn on delete-selection-mode Given I turn on delete-selection-mode
When I insert "Here's text, text and text" When I insert "Here's text, text and text"
@ -54,6 +62,14 @@ Feature: Marking multiple parts of the buffer
And I type "sentence" And I type "sentence"
Then I should see "This sentence has the word sentence in it" Then I should see "This sentence has the word sentence in it"
Scenario: Marking prev like this, word
Given I turn on delete-selection-mode
When I insert "This text has the word text in it"
And I go to last word "text"
And I press "C-S-c C-<"
And I type "sentence"
Then I should see "This sentence has the word sentence in it"
Scenario: Skipping a prev mark Scenario: Skipping a prev mark
Given I turn on delete-selection-mode Given I turn on delete-selection-mode
When I insert "Here's text, text and text" When I insert "Here's text, text and text"

View File

@ -12,6 +12,12 @@
(When "^I mark previous like this$" (When "^I mark previous like this$"
(lambda () (call-interactively 'mc/mark-previous-like-this))) (lambda () (call-interactively 'mc/mark-previous-like-this)))
(When "^I mark previous like this word$"
(lambda () (call-interactively 'mc/mark-previous-like-this-word)))
(When "^I mark previous like this symbol$"
(lambda () (call-interactively 'mc/mark-previous-like-this-symbol)))
(When "^I mark all like this$" (When "^I mark all like this$"
(lambda () (call-interactively 'mc/mark-all-like-this))) (lambda () (call-interactively 'mc/mark-all-like-this)))
@ -144,6 +150,12 @@
(cl-assert search nil message word (espuds-buffer-contents)) (cl-assert search nil message word (espuds-buffer-contents))
(if (string-equal "front" pos) (backward-word))))) (if (string-equal "front" pos) (backward-word)))))
(When "^I go to last word \"\\(.+\\)\"$"
(lambda (text)
(goto-char (point-max))
(let ((search (re-search-backward text nil t)))
(cl-assert search nil "The text '%s' was not found in the current buffer." text))))
(When "^I select the last \"\\(.+\\)\"$" (When "^I select the last \"\\(.+\\)\"$"
(lambda (text) (lambda (text)
(goto-char (point-max)) (goto-char (point-max))

View File

@ -24,6 +24,8 @@
(global-set-key (kbd "C-S-c C->") 'mc/mark-next-like-this-word) (global-set-key (kbd "C-S-c C->") 'mc/mark-next-like-this-word)
(global-set-key (kbd "C-S-c M->") 'mc/mark-next-like-this-symbol) (global-set-key (kbd "C-S-c M->") 'mc/mark-next-like-this-symbol)
(global-set-key (kbd "C-<") 'mc/mark-previous-like-this) (global-set-key (kbd "C-<") 'mc/mark-previous-like-this)
(global-set-key (kbd "C-S-c C-<") 'mc/mark-previous-like-this-word)
(global-set-key (kbd "C-S-c M-<") 'mc/mark-previous-like-this-symbol)
(global-set-key (kbd "M-!") 'mc/mark-all-like-this) (global-set-key (kbd "M-!") 'mc/mark-all-like-this)
(global-set-key (kbd "M-$") 'mc/mark-all-like-this-dwim) (global-set-key (kbd "M-$") 'mc/mark-all-like-this-dwim)
(global-set-key (kbd "C-$") 'mc/mark-all-dwim) (global-set-key (kbd "C-$") 'mc/mark-all-dwim)