vis icon indicating copy to clipboard operation
vis copied to clipboard

underscore in command name prevents them from running

Open xaltsc opened this issue 4 years ago • 1 comments

Registering a command with

vis:command_register("foo_bar", function(argv, force, win, sel, range)
    print("baz")
end, "guu")

Works, however, calling :foo_bar does nothing.

xaltsc avatar Aug 07 '21 14:08 xaltsc

Digits and punctuation chars (except kebab-case - dashes between words) seem to be forbidden: https://github.com/martanne/vis/blob/1ace7169372444d319740c8219b7131e5120428f/sam.c#L656-L659

If this was vim, I would guess that this restriction is so one can use any non-alphabetic character instead of / in commands like s/regex/str/ in order to avoid leaning toothpick syndrome. But in vis commands do not accept non-/ delimiters, so I don't know why this restriction is in place.

ghost avatar Aug 10 '21 14:08 ghost