-
-
Notifications
You must be signed in to change notification settings - Fork 356
feat: Toggle task done command adds global filter text, if enabled #2015
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
74fe90a
86b4372
6d116e6
750df8d
05cca91
5ef7a10
31292fc
ded74e8
a523a0d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -293,7 +293,14 @@ export class DefaultTaskSerializer implements TaskSerializer { | |
| // components but now we want them back. | ||
| // The goal is for a task of them form 'Do something #tag1 (due) tomorrow #tag2 (start) today' | ||
| // to actually have the description 'Do something #tag1 #tag2' | ||
| if (trailingTags.length > 0) line += ' ' + trailingTags; | ||
| if (trailingTags.length > 0) { | ||
| // If the line is empty besides the tag then don't prepend a space because it results in a double space | ||
| if (line === '') { | ||
| line += trailingTags; | ||
| } else { | ||
| line += ' ' + trailingTags; | ||
| } | ||
| } | ||
|
Comment on lines
+296
to
+303
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Various thoughts here... What's the reason for this change in this PR? It seems unrelated. Also, this is the code for the Tasks Emoji format. So what happens when the user is using Dataview task format? Will it produce a double-space because it doesn't have this logic? And what will happen if several more formats are added? Will they all need to have this check? |
||
|
|
||
| return { | ||
| description: line, | ||
|
|
||
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.
It just dawned on me that someone recently spent a lot of time moving all code related to the global filter, including manipulating descriptions, in the new
GlobalFilterclass.If the above cannot be done with the existing methods in GlobalFilter, I feel that the new code should go in to a new method in that class. The existing names there may give ideas.
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 that makes sense. I took a stab at moving as much of the GlobalFilter-related logic to the GlobalFilter class as I could 750df8d. I didn't go all the way because I wanted to keep the regex-related logic in
ToggleDone.ts. Let me know if this matches what you're thinking! If not then I'm open to suggestions.