amp icon indicating copy to clipboard operation
amp copied to clipboard

Can edit and save preferences but they're not applied

Open Munchotaur opened this issue 5 years ago • 10 comments

I just set and saved a few simple preferences:

tab_width: 4
soft_tabs: true
line_length_guide: 72
line_wrapping: true

On restarting amp, none of these were applied. Amp was installed via cargo build in Devuan Ascii.

Am I missing a step somewhere?

Munchotaur avatar Mar 03 '19 17:03 Munchotaur

That seems fine. Did you edit the preferences using the preferences::edit command? My first instinct is that these changes have been written to the wrong file.

jmacdonald avatar Mar 03 '19 17:03 jmacdonald

Yes, initially via preferences::edit, which saved them to ~/.config/amp/config.yml. Is there a way to display which config file is in use after launching amp?

Munchotaur avatar Mar 03 '19 17:03 Munchotaur

Sadly, no, there isn't. However, you can call the preferences::reload command, and if it can't find or create a preferences file at the correct location, it'll raise an error, which will be shown on the status line. That should hopefully provide some insight into what's happening. Let me know how that behaves!

jmacdonald avatar Mar 03 '19 20:03 jmacdonald

Thanks for the tip. No errors thrown unfortunately! Is there a option at launch to load a particular config file?

Munchotaur avatar Mar 03 '19 20:03 Munchotaur

There isn't; the intent is for this to be bulletproof, but clearly it isn't!

Can you try putting a type-specific tab width to see if that applies? I'm not 100% convinced that it's the preference file not being read; it might be that the open buffer isn't triggering those global configuration rules, as weird as that may be. :slightly_smiling_face:

jmacdonald avatar Mar 03 '19 21:03 jmacdonald

Very true -- correctness != bug-free :)

I tried an 'rs' type with a ridiculous width (17 spaces) and that worked perfectly. So I think you're right -- global rules aren't working but type-specific ones are.

Munchotaur avatar Mar 03 '19 21:03 Munchotaur

Nice! I'm curious if the file type itself is confusing the classifier. Can you remove the type-specific configuration and try the global tab_width with same .rs file?

jmacdonald avatar Mar 03 '19 21:03 jmacdonald

OK. that worked too. So maybe it's particular settings that aren't working? I added line_length_guide back and it doesn't appear to have any effect in .rs or plain .txt files.

Munchotaur avatar Mar 03 '19 21:03 Munchotaur

Hmm, line_length_guide works for me; I'm not sure why it wouldn't be applying on your machine. You are seeing the guide, right? It's unlikely, but maybe your terminal colors are set up such that you can't see it, because it matches the background color.

jmacdonald avatar Mar 03 '19 21:03 jmacdonald

A good point. I tend to use dark terminal themes, however I have different dark themes in xfce4-terminal, xterm, sakura and guake and the guide didn't show in any of them.

Same appears to be the case for line_wrapping -- not currently applying either.

My uneducated guess is that both these settings are closely related somehow and that they're being prevented by the same thing...

Munchotaur avatar Mar 03 '19 22:03 Munchotaur