vim-lint icon indicating copy to clipboard operation
vim-lint copied to clipboard

Properly handle ex cmds with capital letters

Open mattboehm opened this issue 12 years ago • 4 comments

ex commands can have capital letters after their first character linecmd's regex should capture this. Also, functions should not call lower() on a command as it's case-sensitive.

For example, before the change: cNext and cNexttttt both are captured as "c" which expands to "change" and we see no error.

mattboehm avatar Nov 20 '13 07:11 mattboehm

Good point!

But before merging it in I think I will first add a couple of unit tests this weekend to make sure it doesn't trip anything up. (Until now, what I've been doing is running vim-lint on a large, correct codebase to look for false positives but that's a bit dirty and getting repetitive :))

dbakker avatar Nov 20 '13 22:11 dbakker

Sounds great! I did some brief checks, but definitely agree that this should be tested more heavily.

mattboehm avatar Nov 20 '13 23:11 mattboehm

There's also the special case of :N[ext]/:N[ext]!, which is a built-in command that starts with a capital letter.

jamessan avatar Nov 22 '13 17:11 jamessan

That's obnoxious as including all uppercase letters would raise errors on user/plugin defined commands. It may be best to ignore that one exception for now, but If you really wanted to, you could extend the regex to include |N(e(x(t)?)?)?

mattboehm avatar Nov 22 '13 20:11 mattboehm