mirror of
https://github.com/magnars/multiple-cursors.el.git
synced 2025-10-13 05:03:03 +00:00
* Fix issue #131 This issue would occur because the function was recieving a raw prefix arg instead of a number. This commit fixes that. * Fix issue with previous commit, add test cases
This commit is contained in:
parent
da069c88e5
commit
6a62e60bf2
@ -16,4 +16,10 @@ Feature: Insert increasing letters
|
||||
Given I have cursors at "text" in "This text contains the word text thrice (text)"
|
||||
When I press "C-u 2 5 H-3"
|
||||
And I press "SPC"
|
||||
Then I should see "This z text contains the word aa text thrice (ab text)"
|
||||
Then I should see "This z text contains the word aa text thrice (ab text)"
|
||||
|
||||
Scenario: Three cursors, a-b-c
|
||||
Given I have cursors at "text" in "This text contains the word text thrice (text)"
|
||||
When I press "C-u H-3"
|
||||
And I press "SPC"
|
||||
Then I should see "This e text contains the word f text thrice (g text)"
|
||||
|
@ -11,3 +11,9 @@ Feature: Insert increasing numbers
|
||||
When I press "C-9 H-0"
|
||||
And I press "SPC"
|
||||
Then I should see "This 9 text contains the word 10 text thrice (11 text)"
|
||||
|
||||
Scenario: Three cursors, 9-10-11
|
||||
Given I have cursors at "text" in "This text contains the word text thrice (text)"
|
||||
When I press "C-u H-0"
|
||||
And I press "SPC"
|
||||
Then I should see "This 4 text contains the word 5 text thrice (6 text)"
|
||||
|
@ -33,7 +33,8 @@
|
||||
(defun mc/insert-numbers (arg)
|
||||
"Insert increasing numbers for each cursor, starting at 0 or ARG."
|
||||
(interactive "P")
|
||||
(setq mc--insert-numbers-number (or arg 0))
|
||||
(setq mc--insert-numbers-number (or (and arg (prefix-numeric-value arg))
|
||||
0))
|
||||
(mc/for-each-cursor-ordered
|
||||
(mc/execute-command-for-fake-cursor 'mc--insert-number-and-increase cursor)))
|
||||
|
||||
@ -58,7 +59,8 @@
|
||||
"Insert increasing letters for each cursor, starting at 0 or ARG.
|
||||
Where letter[0]=a letter[2]=c letter[26]=aa"
|
||||
(interactive "P")
|
||||
(setq mc--insert-letters-number (or arg 0))
|
||||
(setq mc--insert-letters-number (or (and arg (prefix-numeric-value arg))
|
||||
0))
|
||||
(mc/for-each-cursor-ordered
|
||||
(mc/execute-command-for-fake-cursor 'mc--insert-letter-and-increase cursor)))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user