Open hmijail opened 5 months ago
Hi @hmijail , thanks for your suggestion. I understand the part about task dates, and actually, you can configure it to cycle through with a single set of shortcut keys like this:
- example task
=SG0=> - [ ] example task
=SG1=> - [x] example task
=SG1=> - [ ] example task
This setup has a limitation in that it cannot revert to the original list, but it should cover most use cases before the next release.
Regarding other parts, could you provide more potential use cases for non-cyclical changes? This would help me figure out which features to develop.
Your example is helpful, thank you! But it's interesting that I actually tried to change the order of bindings in case it helped to organize the sequence of states, but I couldn't make sense out of it. So maybe some further documentation would help?
As for the non-cyclical changes, it's just one of the ideas I had to control the interaction between groups, to avoid losing information during the transitions. But if the matching is implemented with explicit match and replace fields, then I guess the concept of group is not necessary, so there's no need to deal with their cycles.
Also related: currently I find myself doing this:
- [ ] || ➕ date
stateIs there a way to make the cursor jump to the end of the line automatically once a match happens? (please let me know if this should go to a new issue)
Yes, the order in which commands are bound can affect which state group is used for lookup first. For groups that bind the same command and share common states, this is an important consideration to keep in mind.
The current design intends for the cursor to remain at the same text position after toggling the state. Based on your usage, the cursor should be at the end of the text before switching states, and it should stay the same after the switch. If this is not happening on your end, it might be a bug. Please send me the text snippet and settings involved in reproducing this issue so I can further investigate.
State group:
-
- [ ]
- [ ] || ➕{time:: YYYY-MM-DD}
- [x] || ✅ {time:: YYYY-MM-DD}
{PARAGRAPH}
The hotkey Cmd+Enter is bound to just this group.
Happens with a line containing just "Test", for example.
Obsidian Version 1.5.12 (Installer 1.5.3) ToggleList 1.2.6
Background
Imagine we have a task with a created date, thanks to ToggleList:
When we use ToggleList again to cycle the task status to "done", the existing date is removed and a new one is added:
There is no way to define next states like these with a single hotkey:
(note the [/] checkbox)
Even if we define multiple cycles and hotkeys, for example one to add the creation date ➕ and another to add the finished date ✅, cycling through any of them will remove the corresponding date and re-add today's date (instead of the original one). So going through a cycle causes the existing date to be lost.
Feature Request
It would be great to have a few changes to be able to accomplish these transitions with a single hotkey.
{time:: YYYY-MM-DD}
is used both for matching (so that YYYY-MM-DD is any date) and for adding today's date in the given format. It would be much more flexible to e.g. use grep patterns with subgroups for replacement, where in the replacement we could also add the {time} variable. For example, to finish a task and add to it a finished date while respecting the existing creation date: match: - [ ] (.* ➕[\d-]) replace: - [x] \1 ✅ {time:: YYYY-MM-DD}