complex-repeat Behavior Changed Recently

10 views
Skip to first unread message

JB

unread,
Dec 25, 2020, 1:09:38 AM12/25/20
to v...@vim.org
Hi Vim,
Typing 'qa0xxj' and executing macro 'a' used to go to the beginning of the line, delete the first two chars, then jump down one line. Now, the cursor goes to the beginning of the line and execution of the macro stops -- no deletions or jumping down one line. The same when using '^' or '$'. Leaving out the movement to the beginning or end of the line results in the expected behavior: the macro is executed completely. What gives?


Sent with ProtonMail Secure Email.

Tim Chase

unread,
Dec 25, 2020, 8:44:08 AM12/25/20
to 'JB' via vim_use, v...@vim.org
A few things occur to me:

1) are you doing this in a stock vim? Or do you have some
plugin/mapping that might be interfering? I just tried it here and
it worked fine. Can you replicate within

$ vim -u NONE

2) are you doing it on a blank line where the first "x" would fail,
stopping the rest of the macro's execution?

3) (kinda part of #1) do you happen to have some strange mapping for
"0x" that would interfere with the playback? If you manually type

0xx

does it work for you outside a macro?

4) you are executing this in Normal mode, not some other mode, right?

-tim


JB

unread,
Dec 25, 2020, 6:04:58 PM12/25/20
to vim...@googlegroups.com
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Friday, December 25th, 2020 at 5:43 AM, Tim Chase <v...@tim.thechases.com> wrote:

> On 2020-12-22 19:43, 'JB' via vim_use wrote:
>
> > Typing 'qa0xxj' and executing macro 'a' used to go to the beginning
> >
> > of the line, delete the first two chars, then jump down one line.
> >
> > Now, the cursor goes to the beginning of the line and execution of
> >
> > the macro stops -- no deletions or jumping down one line. The same
> >
> > when using '^' or '$'. Leaving out the movement to the beginning or
> >
> > end of the line results in the expected behavior: the macro is
> >
> > executed completely. What gives?
>
> A few things occur to me:
>
> 1. are you doing this in a stock vim? Or do you have some
>
> plugin/mapping that might be interfering? I just tried it here and
>
> it worked fine. Can you replicate within
>
> $ vim -u NONE
> 2. are you doing it on a blank line where the first "x" would fail,
>
> stopping the rest of the macro's execution?
> 3. (kinda part of #1) do you happen to have some strange mapping for
>
> "0x" that would interfere with the playback? If you manually type
>
> 0xx
>
> does it work for you outside a macro?
> 4. you are executing this in Normal mode, not some other mode, right?
>
> -tim
>
> --

Hi Tim,

I've solved this already, but you were on the right track. The offending lines
in my .vimrc were:

nn 0 ^ | " goto first non-blank char in line
nn ^ 0 | " goto start of line

Replacing the <Tab><Tab> characters preceding the pipes with spaces fixed it.
Executing the Normal command outside of a macro worked fine, but inside a macro failed.
My original mapping used to work, but recently broke.

Solved it by typing ':nn', which listed my Normal noremap-s and showed the <Tab> chars.

Thanks for helping.

Reply all
Reply to author
Forward
0 new messages