vscode-markdown icon indicating copy to clipboard operation
vscode-markdown copied to clipboard

Add a command for checkbox content selection

Open medopaw opened this issue 2 years ago • 7 comments

Proposal

Add a command to select the content of a checkbox line

e.g. "Just do it." is the content of the following checkbox line:

- [ ] Just do it.

It's useful because often I want to mark the whole checkbox content as highlighted or bold or struck-through, like this:

- [ ] ==Just do it.==
- [ ] **Just do it.**
- [ ] ~~Just do it.~~

A command to select the content of a checkbox line can significantly reduce the operation required for this purpose. Please consider.

References

medopaw avatar Mar 11 '22 15:03 medopaw

A list item is a container block. If the task list is a loose list, how many lines should we select? Does such selection have any practical use?

Lemmingh avatar Mar 11 '22 15:03 Lemmingh

Well, if you're not aware of complex loose list, please take look at the "Tasks" section in #1054

Lemmingh avatar Mar 11 '22 15:03 Lemmingh

Does such selection have any practical use?

Strikethrough is a common way to mark a checkbox line as done. And I personally use the other two to mark a check line as the current task or of high priority.

The thing is, if we apply styles to the whole line the checkbox will be rendered as normal text:

- [ ] Just do it. ~~-[ ] Just do it.~~

instead of:

  • [ ] Just do it.
  • [ ] ~~Just do it.~~

A list item is a container block. If the task list is a loose list, how many lines should we select?

Well, if you're not aware of complex loose list, please take look at the "Tasks" section in https://github.com/yzhang-gh/vscode-markdown/issues/1054

I'm aware of the complex loose list now that you mentioned it. Though we can simply select only one line or all the lines, I suggest an alternative approach: how about adding a setting option to allow users to decide which special patterns are treated like strikethrough (~~).

https://github.com/yzhang-gh/vscode-markdown/blob/6b922fb7b29d6a47f069cc783913fa106320f3e0/src/formatting.ts#L346-L350

In this way setting ** and == as special patterns would serve my needs, and it requires less key strokes for me. Please consider. Thx.

medopaw avatar Mar 11 '22 15:03 medopaw

I see this can be (somehow) useful for certain users (that's why we have it for ~~ in the task list).

Although it is a valid feature request, I don't think it is worth doing so far. We need to wait for more feedback from other users.

yzhang-gh avatar Mar 11 '22 16:03 yzhang-gh

I see this can be (somehow) useful for certain users (that's why we have it for ~~ in the task list).

Although it is a valid feature request, I don't think it is worth doing so far. We need to wait for more feedback from other users.

Is it okay that I do it and create a pr? I use a TODO.md as my major task management tool every day and really need it.

This feature simply provides more options. It's very useful for certain users and doesn't interfere with other users.

medopaw avatar Mar 11 '22 16:03 medopaw

Is it okay that I do it and create a pr?

I recommend that you create a customized private fork.

PR implies a transfer of responsibility. If you open a PR here, we would have to go a lengthy review to ensure reliability, which doesn't make much sense for an uncertain experiment.

Lemmingh avatar Mar 11 '22 17:03 Lemmingh

Is it okay that I do it and create a pr?

I recommend that you create a customized private fork.

PR implies a transfer of responsibility. If you open a PR here, we would have to go a lengthy review to ensure reliability, which doesn't make much sense for an uncertain experiment.

Yes I could do a private fork. It's my last resort though: To enjoy new features I'll have to merge with the latest code manually from time to time. Thx for your response anyway.

medopaw avatar Mar 11 '22 17:03 medopaw