-
Notifications
You must be signed in to change notification settings - Fork 290
Tags 2: The return of the tags #342
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
Open
oliverwilliams84
wants to merge
10
commits into
aziz:master
Choose a base branch
from
oliverwilliams84:tagsfix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
05537de
Temp
e8a6e2f
Non-greedy tags.
03457b5
tag encapsulation
4e9fc14
Tags no longer extend into horizontal whitespace - is this a big dealio
889a9c1
calendar appends to tags (NOT @critical etc.)
ab5b9b0
Tags fixed!
074787a
cleanup
312c11b
fixup
90cf2fe
fix
d366b92
whitespaces
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is not reliable enough, e.g. there is option to show date preview for due tag within paranthesis
"due_preview_offset": 1
, as I mentioned in prev pr phantom will change result ofextract_scope
.We also should always expect that view may be affected by other plugins so even if user has default
"due_preview_offset": 0
, still there might be other phantoms.I think we could try to use
view.find
method, i.e. check if cursor is on tag then search@
which is related to this tag (it will be either somewhere on left side of cursor or it might be exactly on right side of cursor), then the point of@
is a starting position forview.find
which allow to use the regex from syntax, i.e. with atomic group etc. Right?Uh oh!
There was an error while loading. Please reload this page.
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.
The whole thing is a workaround to get it working with the re module.
Phantoms only appear after @Due tags, right? That can be worked around with a one time hack if thats so.
Using view.find will work as long as no phantoms throw off the regex. The key feature missing is the regex recursion that makes it all super easy. Probably a much better solution
A more permanent solution is to remove all phantoms at the beginng of the function and put them back at the end which I think is what the other function does? Means the issue should never resurge. Having a single function to reapply the phantoms or just store them and redraw.
Having "due_preview_offset": 1 means that date is inside the brackets while also next to your current text. This works great for
(formatting is fixed in another branch to properly encode the date in dd/mm/yy if that setting is picked)
@due(+2)
but less good for any with short dates as you end up with both dates in the bracket,Does the setting need to effect every date? Does look strange with two dates in the brackets but that's why it's a setting.
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.
How about this
@\w+((\((?=([^()]*))\3|[()]*\))*)
— it works with re module and seems suitable?It behaves as your alternative version, which seems alright to me since the last pair of parenthesis is not separated from the tag, there is no whitespace so we can consider it is a part of tag.
What your thoughts are?
No, phantoms may appear anywhere, because any plugin can add any phantoms to any views; and it is not possible to fully access existing phantoms.
Phantoms do not affect search in any way, afaik, only scopes boundaries.
The preview is supposed to be displayed only if the existing text will be replaced after pressing tab. I would imagine it has problems due to date format and improper use of dateutil.
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.
I'll be taking a break for the exam period but I'll finish up a few improvements when I get time. I've got a in-dev copy that works for just the settings I want but I'll need to polish it so it works for the master release