pear-tree icon indicating copy to clipboard operation
pear-tree copied to clipboard

Wildcard modifier for HTML standalone tags

Open emerdenny opened this issue 4 years ago • 2 comments

The wildcard behavior for HTML autocomplete is a great feature. I'm running into the issue however that for standalone tags the autocomplete will run unnecessarily. Also, the wildcard is smart enough already to avoid the attributes in the tag, which is perfect, and makes me think there might already be a way to do this.

Example:

<input> --completes to--> <input></input> (great) <input type='text'> --completes to--> <input type='text'></input> (great) <input type='text' /> --completes to--> <input type='text' /></input> (unnecessary) <input type='text' /> --completion cancelled--> <input type='text' /> (desired behavior)

Any suggestions on a way to detect the trailing / and cancel autocompletion?

emerdenny avatar Mar 09 '21 15:03 emerdenny

I found this html.vim and loaded it into /.vim/after/ftplugin/html.vim and it hasn't fixed the issue yet (i.e. the autocomplete in .html files doesn't perform desired behavior above)

Another problem is that the HTML tags are often in .js or .jsx files, so the current filetype detection won't catch this issue.

emerdenny avatar Mar 09 '21 16:03 emerdenny