Skip to content

Conversation

@dmaluka
Copy link
Collaborator

@dmaluka dmaluka commented Feb 8, 2026

Micro always saves the undo stack information into the serialized buffer file as long as either saveundo or savecursor is enabled. Whereas in the case when only savecursor is enabled, while saveundo is disabled, this information is not used afterwards, so it only wastes the disk space in ~/.config/micro/buffers. (And given that currently micro never automatically removes any serialized buffer files, it may significantly contribute to the overall ever growing size of the ~/.config/micro/buffers directory.)

So avoid saving the undo info if saveundo is disabled. This makes the size of each serialized buffer file with savecursor=on saveundo=off small and predictable, e.g. around 600 bytes in my observations (whereas without this fix, it may grow indefinitely big, depending on the number of modifications the user made before saving the file).

Context: #3995 (comment)

Micro always saves the undo stack information into the serialized buffer
file as long as either `saveundo` or `savecursor` is enabled. Whereas in
the case when only `savecursor` is enabled, while `saveundo` is
disabled, this information is not used afterwards, so it only wastes the
disk space in `~/.config/micro/buffers`. (And given that currently micro
never automatically removes any serialized buffer files, it may
significantly contribute to the overall ever growing size of the
`~/.config/micro/buffers` directory.)

So avoid saving the undo info if `saveundo` is disabled. This makes the
size of each serialized buffer file with savecursor=on saveundo=off
small and predictable, e.g. around 600 bytes in my observations (whereas
without this fix, it may grow indefinitely big, depending on the number
of modifications the user made before saving the file).
@JoeKar JoeKar merged commit 4aa706c into micro-editor:master Feb 10, 2026
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants