Skip to content
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

Triggering "Toggle task done" on an empty line does not move the cursor to the end of the line #460

Closed
1 task done
jdudleyie opened this issue Dec 23, 2021 · 3 comments · Fixed by #1103
Closed
1 task done
Labels
status: released Done, and included in a public release type: enhancement New feature or request

Comments

@jdudleyie
Copy link

Expected Behavior

When triggering "toggle task done" command on an empty line, when the - plus a space character is inserted, expect the cursor to also be moved to the end of the line (after the space character) so that one could immediately start typing the bullet point text.

Likewise, when triggering "toggle task done" for a second time (twice in a row on an empty line), when the - followed by a space changes to - [ ] followed by a space, expect the cursor to be moved to the end of the line, so that the task title could be typed without the user needing to move the cursor there.

The built in command toggle checklist status appears to have the correct behaviour.

Current Behavior

In the two scenarios above, the cursor remains at the beginning (leftmost position) of the line.

Steps to Reproduce

On an empty line, in edit or live preview mode, trigger the command "Tasks: Toggle task done" once or twice.

Context (Environment)

  • Obsidian version: 0.13.14
  • Tasks version: 1.4.1
  • I have tried it with all other plugins disabled and the error still occurs
@schemar
Copy link
Collaborator

schemar commented Jan 2, 2022

Thank you for the report @jdudleyie. I can reproduce this. I think this regression was introduced with CM6, but I am not sure.

@JenFau
Copy link

JenFau commented Feb 25, 2022

I find both these issues too

@claremacrae claremacrae added the scope: rendering of tasks How the plugin displays tasks (except CSS issues) label Jun 9, 2022
@claremacrae claremacrae removed the scope: rendering of tasks How the plugin displays tasks (except CSS issues) label Sep 3, 2022
claremacrae pushed a commit that referenced this issue Sep 5, 2022
* fix: remove regex for cursor pos, fixes #460

* fix: Add another comment

* test,sample: Add hotkey for Toggle Done and page of test cases for cursor movement

* fix: Adjust cursor properly in ToggleDone
@claremacrae claremacrae added the status: released Done, and included in a public release label Sep 5, 2022
@claremacrae
Copy link
Collaborator

This fix was just released in Tasks 1.13.1

@claremacrae claremacrae removed help wanted Extra attention is needed good first issue Good for newcomers labels Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: released Done, and included in a public release type: enhancement New feature or request
Projects
None yet
4 participants