Issue with toggle checklist status for a selection

Steps to reproduce

Switch to edit mode and enter the following checklist:

A checklist:
- [ ] first do this
- [ ] then do that

Select all of the above text in the editor, or select the complete editor content with Ctrl-A. Then toggle the checklist status with Ctrl-Enter.

Expected result

The two checkboxes should be checked.

Actual result

The two check boxes are checked, but additional unchecked checkboxes are added in the editor, e.g. in front of the text “A checklist:”.

Environment

  • Operating system: Windows 10
  • Obsidian version: 0.9.11

I believe this has worked properly in an earlier version.

I don’t see anything too odd here. Just select the two checkboexs and not select the first row.

@WhiteNoise Sure, in that simple example, you can do that. But if you have long real-life checklists interspersed with separate blocks of explanations (paragraphs, lists or code fences), it does not work any more. Think of something like this:

- [ ] do this:
  ```sh
  some instructions
  ```
- [ ] send mail to:
  - fred
  - lisa
  - karl
  - anna
- [ ] drink coffe

  but do not use too much sugar

  and don't spill it over your desk again
- [ ] be happy

When I select this checklist and press Ctrl-Enter, the additional empty checkboxes will be inserted on every line of the checklist, where they do not belong.

The idea here is that I can go through such a check list, checking off everything that I have done. And then the next time when I run through the same checklist, I can easily reset it using Ctrl-A Ctrl-Enter. I’m pretty sure that worked in the version where the Ctrl-Enter function was introduced.

If this is a regression, I will reopen the bug report.

Otherwise, I think this is more a feature request.
It is an advanced functionality that goes beyond what we is currently envisioned.

Using this trick to completely reset a checklist was suggested in the Discord chat by Licat so I’m pretty sure it was envisioned. But I can also reframe this as a feature request if you think that makes more sense.

The requested feature would then be the ability to reset all checkboxes in a checklist so that the same checklist can be recycled and reused (think of a packing list you want to use every time you go on vacation). Of course, as a workaround you can always do a simple search + replace operation. But I still think it would be nice to have such a feature to quickly check or uncheck all checkboxes on a page. Ctrl-Enter also does (or did) not quite do that, it just toggles everything.