martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.19k stars 259 forks source link

allow snake case in command names #1102

Closed rnpnr closed 1 year ago

rnpnr commented 1 year ago

fixes #971

I have run into this before and it has always seemed like a weird requirement. Anyone against this?

rnpnr commented 1 year ago

Looking at this again it won't work if _ is the last character in the command name. I think that case should be fine for user commands as well. Then correct check should be:

return c && !isspace(c) && !isdigit(c) && (!ispunct(c) || c == '_' || (c == '-' && valid_cmdname(s+1)));

I will fix this and merge if that still sounds fine.