Open bergis opened 2 years ago
To keep the issue clean I was trying to be concise in the template. So adding this here: Thanks for a awsome plugin! So powerful! Great work!
Yes, I do agree that this would be nice to have. Thank you for reporting it.
It's helpful to have the markdown-lint reference too.
/CC @esm7 for info.
@bergis As a temporary workaround, you might want to check out the community plugin Obsidian Linter, which can autofix a number of markdownlint issues if you configure it to. I have mine set to "lint on save" so that I get the benefits of not needing to type the spaces in the middle of typing a task but the trailing one is removed automatically. (Note that Obsidian Linter is currently autofix only; it will not highlight the errors that it is going to fix the way some Markdownlint IDE integrations do, so consider backing up your notes before running the linter. But I have found it to be worth the setup effort!)
That's indeed an annoying issue. There are two cases here that I can think about:
P.S: we can also reformat task lines on save, similarly to the approach of Obsidian Linter, but isn't this too intrusive for a tasks plugin?
Does the completion mechanism add a space after every time it inserts some text? Could that space addition code be removed - and would it all then just work? (Apart from breaking people's muscle memory)
It indeed adds a space after every text insertion; we could change that, but wouldn't that be spilling the baby with the bathwater? Especially on mobile, on which I think the ability to enter task details with almost no typing is a key functionality.
Giving it a thought overnight, I actually now think that lightly touching-up a note's tasks when the cursor moves away from its line, if it was added by completion, is very reasonable and doable. It should be configurable because I can also see the added value in this trailing space for some users, again, especially on mobile. We know a trailing space at the end of the line to be "wrong", but it allows jumping back and forth between lines and notes to add more details to tasks without extra key presses.
I agree with esm7 here: I like the feature of the added space after insertion, even on non-mobile, and would find the additional effort of adding multiple spaces during insertion significantly more than deleting the extra space at the end of the line (or running Linter).
if it was added by completion
Out of curiosity, @esm7 how would you detect that?
I have some more thoughts about this; checking how other auto-complete GUIs work (e.g. Android swipe keyboards), there's also the option of internally marking the line as "space pending", and adding it only if the user continues typing or chooses another selection without moving the cursor. (Unless someone else picks it up first, I will work on this within a few weeks. I'm in a family vacation until the end of the month so unable to do much maintenance here.)
Hi @esm7,
Oooh, that's a nice idea.
Thank you for the offer. No hurry - have a nice holiday!
Expected Behavior
When creating or editing a task in a note (not through the modal) and use on of the drop down quick adds (like "scheduled date" -> "today") an extra space after is added. If this is the last entry of the task and I press enter I expect the trailing space to be removed.
Current behaviour
When creating or editing a task in a note (not through the modal) and use on of the drop down quick adds (like "scheduled date" -> "today") an extra space after the date is added. If this is the last entry of the task and I press enter the trailing space is left behind.
This triggers 009-no-trailing-spaces when linting the markdown file. ( https://github.com/updownpress/markdown-lint/blob/master/rules/009-no-trailing-spaces.md )
Steps to reproduce
When creating or editing a task in a note (not through the modal) and use on of the drop down quick adds (like "scheduled date" -> "today") an extra space after the date is added. If this is the last entry of the task and I press enter the trailing space is left behind.
Which Operating Systems are you using?
Obsidian Version
0.15.9
Tasks Plugin Version
1.11.1
Checks