Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interaction with macros #49

Open
alextes opened this issue Apr 30, 2020 · 8 comments
Open

Interaction with macros #49

alextes opened this issue Apr 30, 2020 · 8 comments
Labels
help wanted Extra attention is needed

Comments

@alextes
Copy link

alextes commented Apr 30, 2020

I was having trouble recording a macro and noticed it appears to be due to the insertion of pairs.

With this extension on running :normal O('') produces a list that looks something like the following:

    (')''')
    ('')'')
    ('')
    (')''')
    ('')'')
    (')''')
    (')''')
    (')''')
    (')''')

Turning it off produces the sequence you'd expect.

('')
('')
('')

It's no biggie, I can turn it off when recording complex macros or use a different plugin but perhaps you do know why this is happening.

@chemzqm chemzqm added wontfix This will not be worked on and removed wontfix This will not be worked on labels Apr 30, 2020
@chemzqm
Copy link
Member

chemzqm commented Apr 30, 2020

Can't reproduce, it works as expected for me.

@chemzqm chemzqm closed this as completed Apr 30, 2020
@alextes
Copy link
Author

alextes commented Apr 30, 2020

I tried switching to jiangmiao/auto-pairs it fixed the problem. Maybe that helps others too.

There could be some third plugin interacting, or perhaps its a timing issue. The fact I get a few different results for the same set of input keystrokes suggests as much.

If you're not interested in digging deeper, that's fine. I understand you're strapped for time.

@chemzqm
Copy link
Member

chemzqm commented Apr 30, 2020

It happens on vim8, not neovim.

@chemzqm chemzqm reopened this Apr 30, 2020
@alextes
Copy link
Author

alextes commented May 1, 2020

Interesting. Sounds more and more like performance / racing condition, in my case it's happening with NVIM v0.5.0-nightly-65-ga8f7841.

Still, using another plugin for pairs is ok too. There are quite a few coc plugins I can't live without 😅 but this one has good alternatives.

Thanks for all the great software!

@chemzqm chemzqm added the help wanted Extra attention is needed label May 20, 2020
@gbprod
Copy link

gbprod commented Apr 16, 2021

Same problem here with NVIM v0.5.0-dev+1225-gbbdd00203
Running :normal O('') will produce randomly: (')'''), (''), '()''', (')''') or ('')'').
Really annoying when using macros.

I really like this auto-pairs plugin and I don't want to change...
How can I help ? An idea from where the problem comes ?

@JoyceBabu
Copy link

The issue is still present. Is there a way to disable the plugin temporarily, before running a macro?

@alextes
Copy link
Author

alextes commented Sep 5, 2022

In help under coc-actions:

"toggleExtension" {id}					*CocAction('toggleExtension')*

	Enable/disable an extension.

So you could run a command, or map toggling it to a keybinding.

I just switched to: https://github.com/jiangmiao/auto-pairs
You could also try:

Because this issue reminded me, I've recently been frustrated writing macros again and just saw my advice above to switch 😅 .

Another thing one could try is to try and use multi cursor more:

@alextes
Copy link
Author

alextes commented Sep 6, 2022

coc-pairs is damn smart. jiangmiao/auto-pairs is out for me. When writing Rust, auto-pairs by default won't pair <, which is a must for type annotations. But when you turn it on, it won't be smart enough not to put <> when you're writing amount_a < amount_b. Which, to be fair, is not trivial, but coc-pairs gets this right!

On to the next 😬 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants