Skip to content

Improved selection logic - #578

Open
peter-yanase wants to merge 5 commits into
vslinko:mainfrom
peter-yanase:main
Open

Improved selection logic#578
peter-yanase wants to merge 5 commits into
vslinko:mainfrom
peter-yanase:main

Conversation

@peter-yanase

Copy link
Copy Markdown

Fixed typos, did not change the logic.

@peter-yanase

Copy link
Copy Markdown
Author

Bumped dependencies to the lowest versions without known vulnerabilities and removed two unused dependencies.

@peter-yanase peter-yanase changed the title Typos Improved selection logic Oct 20, 2025
@peter-yanase

peter-yanase commented Oct 20, 2025

Copy link
Copy Markdown
Author

Added more robust selection logic:

Selects line content if a part a single line is selected or nothing is selected.
Selects whole list (i.e line content + descendants) if multiple lines from single list are selected or the content of a single line is already selected.
Selects parent if the whole list is already selected.
Selects common parent if multiple lists are selected.

Also works with nested task lists - [ ] which the current implementation doesn't support properly.

Kooha-2025-10-23-07-14-06


// Helper functions

function isSamePosition(a: Position, b: Position): boolean {

@AnLuoRidge AnLuoRidge Jan 15, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer areSamePositions() because there're two params. isSamePosition() would make more sense if it is an instance method, used like a.isSamePosition(b).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants