auto-pairs icon indicating copy to clipboard operation
auto-pairs copied to clipboard

Disable add second bracket near word

Open gelerum opened this issue 3 years ago • 4 comments

when add " -> ""request.POST, but should just one"request.POST and if " after world " -> request.POST" should just one when we try add ( it shouldn't add second if before word ( -> (request but if we add after word ( -> request()

gelerum avatar Aug 01 '21 00:08 gelerum

With the exception of the quotes at the end of a word (I think, the single quote handling system may or may not have been expanded in a way that let's this be customized. Need to check when I'm out of bed), my fork has an opt-in option to do this: let g:AutoPairsCompleteOnlyOnSpace = 1

LunarWatcher avatar Aug 01 '21 08:08 LunarWatcher

Same problem here. Not sure if I did it wrong but I tried @LunarWatcher 's fork and had the same issue: when adding a quote right before the first letter of an existing word, it still adds a closing quote so that it goes quoteme -> ""quoteme

DavidFelsen avatar Aug 31 '21 22:08 DavidFelsen

@DavidFelsen no repro. Did you remember to let g:AutoPairsCompleteOnlyOnSpace = 1? Remember to reload the buffer if you're testing live instead of making .vimrc-updates. Off the top of my head as a possible cause if you did both, possible migration problem with your favorite plugin manager. You can make sure you're using my fork with :echo g:AutoPairsVersion. I introduced the variable in my fork, so Vim will error out if you're still on jiangmiao's repo

LunarWatcher avatar Aug 31 '21 22:08 LunarWatcher

Fixed - Indeed the variable wasn't defined so I was still on jiangmiao's version.
I had sourced vim.init (i'm on neovim), ran vimplug to clean the old plugin, saved & closed nvim. I'm not sure why that wasn't enough (vim beginner here!), but only :edit did the trick. It works as expected now, thank you @LunarWatcher!

DavidFelsen avatar Aug 31 '21 22:08 DavidFelsen