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

[suggestion] improved watch stop #15

Closed
MarcoBuess opened this issue Mar 28, 2024 · 4 comments
Closed

[suggestion] improved watch stop #15

MarcoBuess opened this issue Mar 28, 2024 · 4 comments

Comments

@MarcoBuess
Copy link
Contributor

MarcoBuess commented Mar 28, 2024

@Zeioth I wonder if it would make sense, instead of tracking the last execution over a grace period to rather capture the buffer that is currently served and monitor the last write time. Then go and reset the grace period when the buffer was recently written, as one could assume that you are still working on the document. I haven't looked up what the default grace period is but serving just randomly stopped after ~1h when I was still editing the document.

@MarcoBuess
Copy link
Contributor Author

MarcoBuess commented Mar 28, 2024

This would also allow for an autocommand that would stop markmap-cli when the served buffer is closed.
Edit: Which, now that I think about it, could eliminate the need for a grace period alltogehter. Just leave it serving while the buffer is open and shut it down when it closes or nvim exits.

@Zeioth
Copy link
Owner

Zeioth commented Mar 28, 2024

This is the expected behavior, and the simple solution is to just increase the default grace_period from 1h to what you need.

But if you see it's not gonna increase complexity too much and want to send a PR go for it. It is a cool feature.

@MarcoBuess
Copy link
Contributor Author

I just wanted to check, if it's cool with you. I'll see what I can do in terms of a PR. 🚀

@MarcoBuess
Copy link
Contributor Author

See #16

@Zeioth Zeioth closed this as completed Jun 9, 2024
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

No branches or pull requests

2 participants