neoclide / coc-html

Html language server extension for coc.nvim.
208 stars 6 forks source link

coc-html auto tag completion interferes with coc-pairs auto <> completion #32

Closed BrianZhang1 closed 3 years ago

BrianZhang1 commented 3 years ago

As the title says, coc-html auto tag completion interferes with coc-pairs auto <> completion. coc-html autocompletes a tag when it is closed with >, as such: <h1> coc-html autocompletes <h1></h1>

When the > is entered, it auto completes. The problem is, coc-pairs auto completes < to <>. This means that this would happen: < coc-pairs autocompletes <> <h1>

There is no autocompletion from coc-html since the > was technically never entered. To get the auto completion, you would have to delete the closing > and then add it again, and in that time I could probably just enter the closing \ myself. Is there a work around to this?

BrianZhang1 commented 3 years ago

Nevermind. This only happens when the code is unindented. I'll close it up.

LittleTealeaf commented 1 year ago

Hey, how did you fix this? I've been having this exact issue whether or not the code is indented...

chemzqm commented 1 year ago

Can't reproduce, you can disable paired character by filetype like:

    autocmd FileTyp html let b:coc_pairs_disabled = ['<']
LittleTealeaf commented 1 year ago

Ok, thanks! I did just try my dotfile configuration on a fresh virtual machine with the same results. If you want to take a look or try it out, my dotfiles repository is public. Otherwise, your solution might have to work for now

(I put it in the nvim/lua/plugins/_coc.lua config, incase you want to remove it to see the effects)