Skip to content

[BUG] Repeated macro with copy paste #210

@pastacolsugo

Description

@pastacolsugo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions