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

Auto-Save #23

Open
hoijui opened this issue Dec 17, 2017 · 1 comment
Open

Auto-Save #23

hoijui opened this issue Dec 17, 2017 · 1 comment

Comments

@hoijui
Copy link
Collaborator

hoijui commented Dec 17, 2017

where (code)

https://github.com/hoijui/l3afpad/tree/autosave
(will probably never be merged into master, to keep master clean and lean)

what

l3afpad with auto-save functionality.

how

If activated (Options -> Auto Save), saves the current buffers content to a separate, temporary file.
This happens 10 seconds after the last change, or immediately after 150 changes.

Unnamed buffers are stored to "~/.cache/l3afpad/buffers/.txt"

Named buffers are stored to either
"~/.cache/l3afpad/buffers/"
or
"/.
",
depending on the Options -> Auto Save Same Dir config value.

The temporary file is deleted once the user saves to a proper, primary file.

why

I usually have many l3afpad buffers open, because it is so light-weight, and i do lots of note-taking here and there. the nature of my machine is such though, that it often crashes or hangs, or fails to wakeup from suspend, and then i usually lost all my notes (except the manually saved ones).

Therefore, i hacked together this crude auto-save functionality.
It is not yet well tested, and is surely very rough around the edges, but it basically works.
Please feel free to test and comment.
I do not expect this to ever get into the master branch, but maybe someone else has use for it too.

@hoijui
Copy link
Collaborator Author

hoijui commented Feb 14, 2022

Just added a fix to auto-create the cache-dir (~/.cache/l3afpad/buffers/) if it does not yet exist.

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

1 participant