lehitoskin/ivy

Tag format validation

Opened this issue · 0 comments

This is an enhancement proposal for tag editing/entry. I find that usually my tags are in one of a few well-defined formats, which would be very easy to validate. And most of my typos are in the form of a missed comma, or hitting m instead.

If there was a way to specify e.g. "I almost never use spaces" and have Ivy highlight (e.g. red underline) flagged tags while editing, I would have far fewer mistakes.

Implementation

Probably this would be implemented by parsing out individual tags and running them against one or more regex, and marking the offending tag in some way. This should be efficient enough to run "live" as the user types, even with a large number of tags.

Validation patterns could be positive ("tags look like this") or negative ("tags should never look like this") or both (though it's not necessarily obvious which should take precedence).

Technical Challenges

  • Figuring out the exact start/end indices for the offending tag may be tricky
  • Not clear if racket-gui supports decorating text in this way

Related Issues

  • #99 (enhanced tag entry may affect if/how we want to do this)
  • #100 (config file would be required for storing the validation patterns)