zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
25.2k stars 1.18k forks source link

Can't edit `settings.json` #3484

Open tsilvs opened 1 month ago

tsilvs commented 1 month ago

Description of the problem or steps to reproduce

Every time I'm editing & saving ~/.config/micro/settings.json it is being reset by something. And the editor prompts with The file on the disk has changed.. Permissions are correct. Ownership is correct. Doing this as the owner. Nothing is using the file, according to sudo fuser ~/.config/micro/settings.json.

Specifications

Andriamanitra commented 1 month ago

Micro does some slightly annoying auto-formatting on the file whenever settings are changed (with the set command or config.SetGlobalOption in Lua) even if the new value for the option is the same as the existing one. You might have have some plugin that is programmatically changing an option.

You can disable "The file on the disk has changed" prompt by setting set reload auto.

dmaluka commented 1 month ago

Also 225927b is 2.0.11 i.e. a pretty old version of micro. Since 2.0.14 we have the fix #3009 which avoids unexpected rewriting of settings.json in most cases.

tsilvs commented 1 month ago

a pretty old version of micro

I am currently using micro from Fedora repo. Will contact maintainers to ask them to update it.

JoeKar commented 1 month ago

I am currently using micro from Fedora repo. Will contact maintainers to ask them to update it.

Hm, right...pretty old, what they package right now. Even debian offers a newer package from testing onwards. Anyway, there is already the "bug" reported/identified by the upstream release monitor (2238002) of Fedora, while for Debian it is 1080422. Nevertheless you can use our generic and static artifact for v2.0.14 (micro-2.0.14-linux64-static.tar.gz + micro-2.0.14-linux64-static.tar.gz.sha) as long as it isn't available as package in your favorite distribution.

We should be ready to close this issue, am I right?