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

Feature request: add a callable refresh function #44

Open
sforli opened this issue May 16, 2023 · 3 comments
Open

Feature request: add a callable refresh function #44

sforli opened this issue May 16, 2023 · 3 comments
Labels
enhancement New feature or request todo candidate Issues that are candidates for being up next to do

Comments

@sforli
Copy link

sforli commented May 16, 2023

It would be great to have a way to refresh the content of a file using a key combo but also using some kind of programatic way (socket? external command?). This would be perfect for using the viewer in a preview splits with text editors like Vim and/or Tmux environments.

@davep davep added the enhancement New feature or request label May 17, 2023
@davep
Copy link
Contributor

davep commented May 17, 2023

A refresh key at the very least does seem like a good idea (perhaps also, for local files, the ability to turn on a "watch" mode for the current file and reload it if it appears to change).

@sforli
Copy link
Author

sforli commented May 24, 2023

I love the idea of monitoring for changes! It could be done either by using a cheap timed loop or something more sophisticated like watchdog.

@davep
Copy link
Contributor

davep commented May 24, 2023

Yup, something like that would be the plan. Ideally first I want us to make some enhancements to the Textual Markdown widget that would help with this working really well (things that would help with keeping position in the document so it doesn't keep jumping back to the top, etc).

davep added a commit that referenced this issue May 28, 2023
Consider this a "hits most use cases" initial take on #44; I think this is
needed anyway. Reloading based on external input should follow later, but I
think those things make more sense when I can make a best-efforts attempt at
reloading and ending up at the same position (which would help make things
feel more like a live-edit viewer).

Anyway, that's a different request/PR. This is about a simple refresh.
@davep davep added the todo candidate Issues that are candidates for being up next to do label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request todo candidate Issues that are candidates for being up next to do
Projects
None yet
Development

No branches or pull requests

2 participants