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

Micro reindents settings.json files with spaces on open #3331

Open
pwhelan opened this issue Jun 6, 2024 · 1 comment
Open

Micro reindents settings.json files with spaces on open #3331

pwhelan opened this issue Jun 6, 2024 · 1 comment

Comments

@pwhelan
Copy link

pwhelan commented Jun 6, 2024

Description of the problem or steps to reproduce

When opening JSON files, even with all possible ftoptions settings set to tabstospaces:false micro keeps reindenting then overwriting the settings file with spaces instead upon opening.

This does not happen with any other files, just settings.json, as far as I can tell.

This is my settings.json file:

{
    "*.json": {
        "tabstospaces": false
    },
    "colorscheme": "simple",
    "ft:json": {
        "tabstospaces": false
    },
    "ftoptions": false,
    "tabsize": 8
}

Specifications

Version: 2.0.13
Commit hash: 68d88b5
OS: macOS
Terminal: iTerm2 3.5.0
Compiled on June 06, 2024

@dmaluka
Copy link
Collaborator

dmaluka commented Jun 6, 2024

There was a bug #2647 causing needless overwriting of settings.json every time when micro starts. It was fixed in #3009 but this fix is not present in 2.0.13.

After the fix, micro writes settings.json only when the user sets an option via the set command in micro. In that case, micro still enforces a "canonical" JSON formatting, in particular replaces tabs with spaces. So if you don't want micro to mess with your settings.json, just don't use the set command.

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