cursorless-dev / cursorless

Don't let the cursor slow you down
https://www.cursorless.org/
MIT License
1.13k stars 79 forks source link

In markdown "chuck item <target>" and "take item <target>" select different things #2384

Open maxbruening opened 4 months ago

maxbruening commented 4 months ago

In markdown "chuck item " and "take item " select different things at times. I noticed this when I had a file with a markdown list. "chuck item" would drop the first level and second level of the list item. "Take item" would only select the first level of the list. My file looked something like the following:

This may be related to #585

pokey commented 4 months ago

I couldn't reproduce this. I had the following markdown file:

- This is the first level of a list.
  - This is the second level of a list. 

I verified that "chuck item" and "take item" differed only in the fact that "chuck item" remove the leading - and "take item" excludes it, which is expected. I tested both the nested and top-level item. Any idea what's different for me here?

maxbruening commented 4 months ago

I confirm that the behavior is not present in the file specified as before. However it is present when we add another list item, e.g.:

- This is the first level of a list.
  - This is the second level of a list. 
- This is the first level of a list again.

I believe it is confusing for users that the presence of a following list item changes the behavior. Although one could argue that if one wants to delete the first level of a list then the second level should not remain by itself. I could also use "chuck line" if I only wanted to delete one line, so I guess it should be preferred that "chuck item" also deletes lower list levels? But I guess then the behavior should be consistent, i.e. "take item" should also select lower list levels.

pokey commented 3 months ago

Yes "chuck" and "take" should absolutely be consistent, and presence of subsequent list item should not alter behaviour of either. I'll see if I can reproduce