-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Forbid unparseable facts #476
Conversation
Thanks! Yes this solves #461 (comment) reasonably well, as well as the two issues closed by the previous two commits. I noticed that the parser changes allow "#" in any position in the activity name, in addition to the first, which is fine with me. Playing with this a bit, I noticed some quirky behaviour. For example, typing (ps. very glad you're back!) |
Thanks for the feedback, glad you're still there ! Just noticed: adding a comma in the middle of a tag in the gui cmdline wreaks havoc. 😞 |
@@ -23,7 +23,7 @@ | |||
tag_re = re.compile(r""" | |||
[\s,]* # any spaces or commas (or nothing) | |||
\# # hash character | |||
([^#\s]+) # the tag (anything but # or spaces) | |||
([^#\s,]+) # the tag (anything but #, spaces or comma) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change would fix the strange behaviour with #456@cat
:
([^#@\s,]+) # the tag (anything but #, @, spaces or comma)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't that forbid '@' in tags and be a regression ?
IMO the behavior is certainly puzzling at first sight, but clearly understandable
if the rules can be kept simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, so we also need to allow @ in the middle of tags. I never would have imagined that. Okay.
Looking at the Input help page (eg. here), it seems that "#tag with spaces" is explicitly mentioned. This no longer works with this PR (or maybe earlier). For cmdline input |
Perfect, that used to work in v2.0 (c3e5fb7), indeed; edit: Lines 63 to 66 in 9fe4518
So parser backward compatibility seems impossible to achieve. |
superseded by #481 |
Make the save button active only if the fact entered can be parsed (and thus edited) from the cmdline.
This hopefully answers #461 (comment) favorably, while waiting for #465.
The first two commit are from PR #475, only a544d5e is added by this PR.