A fairly chunky PR to bring note/flag/correct behaviour in line with user expectations:
Notes of type 'note' and notes of type 'flag'/'correct' do not interact, allowing overlaps between the two.
Notes that touch or overlap other notes of the same type on creation are merged.
There are a few edge cases solved here, including correct mark setting for the cursor position between touching notes, correct decoration as cursor moves through inside positions across touching notes, and correct cursor behaviour when two kinds of notes are stacked and start/end on the same character.
Implementation notes:
I've created a new class to manage sharing state between noter plugins, the alluringly named SharedNoteStateTracker. Superlative name aside, this is a somewhat clunky solution - the implementation works but I'm super open to a refactor.
Similarly, we use the 'appendTransaction' hook to apply a change of state for the edge case mentioned above. Is there a better place to put this behaviour? Or can filter and append behaviours be merged? (Appending a transaction re-triggers the filter operation!)
A fairly chunky PR to bring note/flag/correct behaviour in line with user expectations:
There are a few edge cases solved here, including correct mark setting for the cursor position between touching notes, correct decoration as cursor moves through inside positions across touching notes, and correct cursor behaviour when two kinds of notes are stacked and start/end on the same character.
Implementation notes:
I've created a new class to manage sharing state between noter plugins, the alluringly named SharedNoteStateTracker. Superlative name aside, this is a somewhat clunky solution - the implementation works but I'm super open to a refactor.
Similarly, we use the 'appendTransaction' hook to apply a change of state for the edge case mentioned above. Is there a better place to put this behaviour? Or can filter and append behaviours be merged? (Appending a transaction re-triggers the filter operation!)