15 Commits
Author SHA1 Message Date
Dmytro Maluka 4aa706cbc5 serialize: Don't save undo stack if saveundo=off (#4003)
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).
2026-02-10 20:32:16 +01:00
Jöran Karl 4ead0e453b Change zyedidia/micro to micro-editor/micro 2026-01-21 20:29:55 +01:00
Jöran Karl 02611f4ad2 backup: Keep path of stored & hashed backup files in a own $hash.path file
Since full escaped backup paths can become longer than the maximum filename size
and hashed filenames cannot be restored it is helpful to have a lookup file for
the user to resolve the hashed path.
2025-10-18 21:07:06 +02:00
Jöran Karl c972360386 serialize: Perform write process safe 2025-02-28 18:57:53 +01:00
Jöran Karl 69064cf808 util: Improve and rename EscapePath() to DetermineEscapePath()
If the new URL encoded path is found then it has precedence over the '%' escaped
path. In case none of both is found the new URL approach is used.
2025-02-28 18:57:53 +01:00
fc3dd9a62f Fix quality issues (#1856)
* Add .deepsource.toml

* Remove unnecessary comparison with bool

* Remove unnecessary use of slice

* Replace multiple `append`s with one

* Remove unnecessary wrapping of function call

* Fix check for empty string

* Simplify error creation with `fmt.Errorf`

* Fix defers before error check

Signed-off-by: sourya_deepsource <[email protected]>

* Remove untrappable `os.Kill` signal

Signed-off-by: sourya_deepsource <[email protected]>

* Remove empty else branch

Signed-off-by: sourya_deepsource <[email protected]>

* Add missing error check

Signed-off-by: sourya_deepsource <[email protected]>

* Merge variable declaration and assignment

Signed-off-by: sourya_deepsource <[email protected]>

* Remove unnecessary `nil` check

Signed-off-by: sourya_deepsource <[email protected]>

* Revert changes to generated files

Signed-off-by: sourya_deepsource <[email protected]>

* Remove .deepsource.toml

Signed-off-by: sourya_deepsource <[email protected]>

Co-authored-by: DeepSource Bot <[email protected]>
Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
2020-09-16 00:08:01 -04:00
Zachary Yedidia eff89a98a7 Fix v2 import path for go mod 2020-05-04 10:16:15 -04:00
Zachary Yedidia 695d4c2b1b Use filepath.Join more 2020-02-11 13:09:17 -05:00
Zachary Yedidia 6a1b8f4a4f Add option to clean unused settings and other parts of config 2020-02-02 15:30:06 -05:00
Zachary Yedidia 6c3814dfac Better message for gob error 2020-01-05 12:45:27 -05:00
Bonnie c2c0325384 Fix #1383: "Save with Sudo" rewrite (#1424)
* Rewrite save with sudo (Fixes #1383)

* Combine overrideFile & overrideFileAsRoot into 1 function
2020-01-03 17:39:12 -05:00
Zachary Yedidia 6681387b47 Support for file reloading if changed externally 2019-12-26 17:59:23 -05:00
Zachary Yedidia aa774164a7 Fix relocate bug 2019-12-25 17:05:10 -05:00
Zachary Yedidia adfeaf52ba Fix serialization 2019-12-25 17:05:10 -05:00
Zachary Yedidia 0612af1590 Change project layout and use go.mod 2019-12-25 17:05:10 -05:00