meow-edit / meow

Yet another modal editing on Emacs / 猫态编辑
GNU General Public License v3.0
1.07k stars 128 forks source link

Beacon change/replace macro doesn't work too well with consecutive characters #539

Closed trev-dev closed 3 months ago

trev-dev commented 4 months ago

In this example, there are consecutive dashes behind the arrow :)

 1. Move the cursor to the line below marked -->
 2. Select the whole symbol with W
 3. Press G to activate secondary selection
 4. Press - f and - to backward search for
    character -, will create fake cursor at each -
 5. Meow will start recording. Press c to switch to Insert mode
    (character under current cursor is deleted)
 6. type _
 7. Press ESC to go back to NORMAL, then the macro will
    be applied to all fake cursors.
 8. Press G again to cancel the grab
----------------
 --> x-y-foo-barbaz
     x_y_foo_bar_baz

If I follow the directions, I noticed that I ended up with _-> x_y_foo_barbaz. I thought the _-> was funny, so I tried the same thing with --- -- --- - - - -- and what I got was _-_ _- _-_ _ _ _ __. Is this maybe a limitation of the beacon feature?

DogLooksGood commented 4 months ago

Sorry, I'm not quite understand. Do you mean some _ are translated to -?

trev-dev commented 4 months ago

It's almost as if the beacon mode is unable to [c]hange all of the hyphens it puts a cursor on. Steps to reproduce:

  1. Open a scratch buffer
  2. Insert this text: --- -- --- - - - --
  3. Leave Insert mode and leave your cursor at the end of the line. Then enter the following commands: xG-f-c_, then ESC to exit back to normal mode and complete the batch macro.
  4. Observe the results: _-_ _- _-_ _ _ _ __
DogLooksGood commented 4 months ago

Thanks! Now I can reproduce it.

DogLooksGood commented 3 months ago

Fixed with f5ca6e7