vim-utils / vim-troll-stopper

Stop Unicode trolls from messing with your code.
MIT License
177 stars 4 forks source link

Troll Stopper doesn't work on Vim 7.4.x? #8

Closed scottchiefbaker closed 6 years ago

scottchiefbaker commented 7 years ago

TrollStopper works fine on Vim 8.x, but when I try and use it on Vim 7.4.160 (which is the system Vim that ships with CentOS 7.3) I get the following error:

Error detected while processing function <SNR>28_HighlighTrolling:
line    7:
E118: Too many arguments for function: matchadd

Any ideas?

scottchiefbaker commented 7 years ago

I'm not sure exactly what matchadd() does, but help matchadd in Vim 7.4 and 8.0 are different. It looks like the fifth parameter (dict) was added in 8.0.

# Vim 7.4.160
matchadd({group}, {pattern}[, {priority}[, {id}]])
# 8.0.562
matchadd({group}, {pattern}[, {priority}[, {id}[, {dict}]]])
scottchiefbaker commented 6 years ago

Just a quick ping on this. It's still an issue for me :(

bruno- commented 6 years ago

Hi,

can you please try pulling the latest plugin version and see if it works now?

The line you're having the issue with is now optional and is not executed by default. This commit made it not being executed by default https://github.com/vim-utils/vim-troll-stopper/commit/11b604c60880cefcd30ec68dce793ae64c3cc099

scottchiefbaker commented 6 years ago

Whatever you did has fixed my issue. Thank you!