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

Store only the changed settings in the advanced settings.txt #3237

Closed
goyalyashpal opened this issue Jan 22, 2023 · 3 comments
Closed

Store only the changed settings in the advanced settings.txt #3237

goyalyashpal opened this issue Jan 22, 2023 · 3 comments

Comments

@goyalyashpal
Copy link

goyalyashpal commented Jan 22, 2023

This idea was on my mind for quite a long time; was a bit unsure earlier, but I got confirmed that it is correct when i saw an actual implementation of it in the config file of helix editor.

So, currently, sumatra stores all the settings in the SumatraPDF-settings.txt - and rewrites them everywhere a setting is changed from UI and at various other triggers/events I suppose.

The suggestion is to internally store a default configuration, and append (i.e. write at end) the SumatraPDF-settings.txt with only those settings which are changed. This approach is used by various TUI based applications, and is really helpful.

It will also allow #3043 and will ease the process for running with default config for diagnosing bugs.
This will require #1174

@goyalyashpal
Copy link
Author

goyalyashpal commented Jan 22, 2023

While searching for content for helix-editor/helix#396 (comment) , just found out that Python does this too:

Non-default user settings are saved in a .idlerc directory in the user’s home directory. Problems caused by bad user configuration files are solved by editing or deleting one or more of the files in .idlerc.
- Python: 3 IDLE
- Python: 2.7 IDLE

@GitHubRulesOK
Copy link
Collaborator

GitHubRulesOK commented Jan 22, 2023

MuPDF itself hides (nix like) the history settings in user root thus not very useful as a portable app, SumatraPDF Portable keeps portable settings file in exe folder like most Traditional PortApps did/do (there can be problems with other moder PortableApp Clones that use multiple ini regs and dat's.)

The historic settings were not exposed as a txt type file but a dat file for only application but over time extra user acessible features have been added so as to keep sessions against failure in that same one control set. The set could be made inaccessible like MuPDF to avoid interference, but as it stands almost one file fits all. (exception is the thumbnails error or runtime or crash logs, etc.)

@kjk
Copy link
Member

kjk commented Feb 6, 2023

Too much work for the benefit.

Also, having all the settings listed in the file educates people about what the settings are.

@kjk kjk closed this as completed Feb 6, 2023
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

3 participants