Jelmerro / Vieb

Vim Inspired Electron Browser - Vim bindings for the web by design
https://vieb.dev
GNU General Public License v3.0
1.29k stars 61 forks source link

Fix: cant write to disk erwic settings that match defaultSettings #479

Closed rafael-xmr closed 1 year ago

rafael-xmr commented 1 year ago

defaultSettings has for example containernewtab set to s:usecurrent, and when running an erwic application the setting is set to s:external, but when trying to set it back to s:usecurrent and running mkviebrc to write to disk, the setting can't be saved as it still matches the defaultSettings default, so erwic applications will always run overriding these settings that can't be saved. This change instead replaces the defaultSettings value when running an erwic application, and then allowing that setting to be written to disk when changed as it won't match the new defaults

Jelmerro commented 1 year ago

This is not the correct solution, because now the actual Erwic defaults can't be written, even though a datafolder is not erwic specific (a folder might be used for erwic AND regular usage at different times) and because settings are not prefixed with s: in all cases, just the special names for the container settings are, others don't need or accept the s: prefix.

Jelmerro commented 1 year ago

Thanks for making a potential fix for this though, I'll think of a better solution for this or feel free to suggest one!

rafael-xmr commented 1 year ago

Ah, sorry for rushing with this without even opening a tracking issue, just wanted to get this working here so I did the changes, what do you think about the new commit? I think the new erwic defaults const also make it easier to modify in the future by changing one line in the object

Jelmerro commented 1 year ago

Yes, this is much better, thanks for fixing this!