Vintage icon indicating copy to clipboard operation
Vintage copied to clipboard

[BUG] Repeated macro with copy paste

Open pastacolsugo opened this issue 5 years ago • 0 comments

Problem:

You record a macro q that copies some text and pastes it. You repeat said macro n times with n@q. The macro is applied n times, but also the paste operation in the first macro execution is repeated n times.

Steps to reproduce:

  1. Open a buffer with a word per line, like this:
foo
bar
banana
apple
orange
  1. In Command Mode, place your cursor at the beginning of the file.
  2. Record this macro:
qq (record on q)
viw (select the word, foo in this case)
y$p (copy and paste at the end of the line
j (down one line)
0 (go to the beginning of the line)
q (stop recording)
  1. You should have:
foofoo
bar
banana
apple
orange

with your cursor at the beginning of the second line, in command mode. 5. Replay with 3@q

Expected result

foofoo
barbar
bananabanana
appleapple
orange

Actual result

foofoo
barbarbarbar
bananabanana
appleapple
orange

bar is pasted 3 times.

Version and OS

Sublime Text 3.2.2, Build 3211 Vintage mode enabled MacOS High Sierra 10.13.6

pastacolsugo avatar Jan 04 '20 22:01 pastacolsugo