Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: Make zoom state part of view state #115

Open
pjeby opened this issue Feb 29, 2024 · 0 comments
Open

[FR]: Make zoom state part of view state #115

pjeby opened this issue Feb 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@pjeby
Copy link

pjeby commented Feb 29, 2024

Currently, when navigating forward or back in history, switching workspaces, or restarting Obsidian, the zoom state is lost. It would be helpful if the current zoom information could be included in the view state (and set from it), so that the zoom state is persistent.

One way this could be implemented would be to wrap the get/set state functions for the markdown editing subview to add an extra property to the ephemeral state (on get), and to query it (on set) to apply it.

Since notes can change on disk while the note is not visible, it would probably be best for the state to be include either a "subpath" link (in the case of header/block zoom, i.e. #header-name or #^block-id) or the text of the list item. On loading of the state, the note can be checked to ensure that the matching header/text/block is in the correct place, and if not, search for it. (This approach would also allow Hover Editor to pop notes up already zoomed to the target of a header/block link.)

I'd be willing to work on a PR for this, if you're open to the idea. Thanks!

@pjeby pjeby added the bug Something isn't working label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant