Skip to content

Be less strict about spaces in snippet names

Thomas Friedrichsmeier requested to merge work/snippets into master

Long explanation for a small change: In RKWard, we came across the question, why the UI for editing snippets rejects names with spaces. This would obviously seem useful, and "just works", when editing the XML storage, directly. I believe the original reason for this choice may have been that spaces would not work very well with text completions.

On the other hand, it seems worth pointing out: a) I for one was not even aware of completions for snippets before searching the code for reasons for the above. b) While completions for snippets can be quite terrific, indeed, this will mostly be for the use case of "shortcut for inserting a complex piece of text", but not so much for the use case of "cheatsheet-like reminder for some syntax that I keep forgetting", as in the latter case you will be more likely to browser a list of names, rather than having the name memorized.

So, this patch simply allows a bit more rope, while still showing a warning. As a side-effect, that may even serve as a tiny path to discovering the completions feature.

While at it, I modernized the reject message.

Merge request reports

Loading