obsidian-tasks
obsidian-tasks copied to clipboard
Auto-suggest for dependencies restricts the characters that can be used when filtering task descriptions
Please check that this issue hasn't been reported before.
- [X] I searched previous Bug Reports didn't find any similar reports.
Expected Behavior
When using auto-suggest to add tasks to the dependsOn field, I would sometimes like to use hyphen, underscore and punctuation in my searches.
Other users may want to search for letters with accents, non-Latin characters.
Current behaviour
The characters recognised when searching task descriptions are defined here:
https://github.com/obsidian-tasks-group/obsidian-tasks/blob/bcee94a9e5eaa32a3dd2068de56824bb2878c3d2/src/Suggestor/Suggestor.ts#L446
The current options are:
[0-9a-zA-Z ^,]
Steps to reproduce
- Create a note in Obsidian
- Paste in these lines
- [ ] #task Book the café
- [ ] #task Pay the café
- Put the cursor at end of second line
- Type
[space]dep
- Select the 'depends on' option
- Type
caf
- note that first task is in the suggestions list - Type
é
- note that the first task disappears from the suggestions list
Which Operating Systems are you using?
- [ ] Android
- [ ] iPhone/iPad
- [ ] Linux
- [X] macOS
- [ ] Windows
Obsidian Version
1.6.0
Tasks Plugin Version
pre-7.2.0 development release
Checks
- [ ] I have tried it with all other plugins disabled and the error still occurs
Possible solution
I tried just increasing the range of characters allowed in the above regex, but then found that if the cursor was after dependsOn
in the middle of an existing line, such as with a due date afterwards, the later text in the line was included in the filtering of tasks to add to the suggest drop-down, which usually meant that no tasks were found.
I think the regex is going to need to be changed to something like:
- Allow any character except:
- Any of the emojis used by Tasks
-
[]()
in case it's dataview format
This is going to be rather hard to write automated tests for, due to all the positioning of cursors required...