jmacdonald / amp

A complete text editor for your terminal.
https://amp.rs
Other
3.75k stars 106 forks source link

Can edit and save preferences but they're not applied #137

Open Munchotaur opened 5 years ago

Munchotaur commented 5 years ago

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?

jmacdonald commented 5 years ago

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.

Munchotaur commented 5 years ago

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?

jmacdonald commented 5 years ago

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!

Munchotaur commented 5 years ago

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

jmacdonald commented 5 years ago

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:

Munchotaur commented 5 years ago

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.

jmacdonald commented 5 years ago

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?

Munchotaur commented 5 years ago

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.

jmacdonald commented 5 years ago

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.

Munchotaur commented 5 years ago

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...