artisticat1 / obsidian-latex-suite

Make typesetting LaTeX as fast as handwriting through snippets, text expansion, and editor enhancements
MIT License
1.43k stars 56 forks source link

New architecture to manage tabstops #306

Closed bdm-k closed 4 months ago

bdm-k commented 5 months ago

This PR introduces a new method for managing tabstops. With the updated architecture, we can reduce the chances of bugs described in issues #303 and #254 occurring.

Changes

Currently, we need to dispatch the dedicated state effects multiple times to update tabstopsStateField, which is a bit complicated. However, with the new implementation, we'll only need to dispatch a single transaction that provides the new editor selection. As a result, since the tabstopsStateField is updated based solely on editor selection changes, we no longer need to listen to view updates to keep tabstop groups in the correct state.

Details

Demo

Before

https://github.com/artisticat1/obsidian-latex-suite/assets/54701853/cb6081e1-fb0e-413d-8853-e8a99adf63db

After

https://github.com/artisticat1/obsidian-latex-suite/assets/54701853/f9a5a7fc-8779-4174-bb74-efa131a493bf

alexnegron commented 5 months ago

Excellent. Thank you!

artisticat1 commented 5 months ago

Thanks for the PR! I'll try to review it in the next week or so.

artisticat1 commented 4 months ago

It looks good to me. Thank you!