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

winmerge-settings.ini corrupted #2685

Open
dcog989 opened this issue Mar 23, 2025 · 4 comments
Open

winmerge-settings.ini corrupted #2685

dcog989 opened this issue Mar 23, 2025 · 4 comments

Comments

@dcog989
Copy link
Contributor

dcog989 commented Mar 23, 2025

winmerge-settings-corrupted.zip

While designing a new theme for WinMerge I noticed that my settings ini file had grown to over 4000 lines because garbage text was being added each time I updated settings - e.g.:

ResizeableDialogs/SaveClosingDlg=1614,767,2226,1393
rFilterPath=D:\Documents
ents

ttings/CSVDelimiterCharacter=,
ngs/TSVFilePatterns=*.tsv
*.tsv
oInclude=
mDlgDontAskAgain=6
(){}<=>`'!"#$%&^~\|@+-*/


leTypes/ASP.exts=asp;ascx
x
leTypes/ASP.exts=asp;ascx
s;vb;vbs;frm;dsm;cls;ctl;pag;dsr
r
s;vb;vbs;frm;dsm;cls;ctl;pag;dsr
;dsm;cls;ctl;pag;dsr

;dsm;cls;ctl;pag;dsr
sr

;dsm;cls;ctl;pag;dsr

;dsm;cls;ctl;pag;dsr

;dsm;cls;ctl;pag;dsr

;dsm;cls;ctl;pag;dsr
r

;dsm;cls;ctl;pag;dsr
;dsm;cls;ctl;pag;dsr
l;pag;dsr
r

;dsm;cls;ctl;pag;dsr
;dsm;cls;ctl;pag;dsr
;ctl;pag;dsr
;dsm;cls;ctl;pag;dsr
ag;dsr
;dsm;cls;ctl;pag;dsr
sr
ag;dsr
;dsm;cls;ctl;pag;dsr
ag;dsr
;dsm;cls;ctl;pag;dsr
r
ag;dsr
;dsm;cls;ctl;pag;dsr

This was happening when I was comparing a saved version of my settings file against the current settings file which I made local by starting WinMerge with "C:\Program Files (x86)\WinMerge\WinMergeU.exe" /inifile "C:\Users\Bubba\AppData\Roaming\WinMerge\winmerge-settings.ini". Could this be the issue?

Another possibility is that I had commented my theme file, like so:

DefaultSyntaxColors/Bold13=0 ; preprocessor
;DefaultSyntaxColors/Bold14=0 ; ??????
;DefaultSyntaxColors/Bold15=0 ; ??????
;DefaultSyntaxColors/Bold16=0 ; ??????
;DefaultSyntaxColors/Bold17=0 ; ??????
;DefaultSyntaxColors/Bold18=0 ; ??????
;DefaultSyntaxColors/Bold19=0 ; ??????
DefaultSyntaxColors/Bold20=0 ; User 1
DefaultSyntaxColors/Bold21=0 ; User 2
;DefaultSyntaxColors/Bold22=0 ; ??????
;DefaultSyntaxColors/Bold23=0 ; ??????
;DefaultSyntaxColors/Bold24=0 ; ??????
;DefaultSyntaxColors/Bold25=0 ; ??????

;------------------------------------------------------------
; Syntax Colors
DefaultSyntaxColors/Color00=0x82e31a ; ?????? #82e31a #1ae382
DefaultSyntaxColors/Color01=0x363636 ; whitespace background
DefaultSyntaxColors/Color02=0x363636 ; regular text background
DefaultSyntaxColors/Color03=0xd4d4d4 ; text color
DefaultSyntaxColors/Color04=0x303030 ; margin line numbers background
DefaultSyntaxColors/Color05=0x408080 ; selected text background
DefaultSyntaxColors/Color06=0xdedede ; selected text color
DefaultSyntaxColors/Color07=0xe9c8a0 ; keywords
DefaultSyntaxColors/Color08=0xeec6f9 ; function names

Maybe those comments were the cause? Although the problem seems to have gone away now I've gone back to using the registry?

@sdottaka
Copy link
Member

At the moment I don't know the cause, but I was able to reproduce the issue where invalid lines were added when pressing the OK button in the Options dialog while comparing the INI files being used.

@dcog989
Copy link
Contributor Author

dcog989 commented Mar 24, 2025

Did you also notice that there seems to be a long delay in saving / updating? Perhaps it is related to the invalid data being added?

@sdottaka
Copy link
Member

Did you also notice that there seems to be a long delay in saving / updating? Perhaps it is related to the invalid data being added?

So far I haven't noticed any long delays.

It seems that this issue can be avoided by unchecking the "Another application updated %1since last scan. Reload?" checkbox in the Message Boxes section of the Options dialog.

I suspect that this issue occurs when writing to an INI file and reading from it at the same time, but I can't think of a solution at the moment.

Image

@dcog989
Copy link
Contributor Author

dcog989 commented Mar 25, 2025

There was a definite delay for me compared to normal operation - which is instant when pressing OK to save settings.

Yeah, that would make sense - both writing and reading to the settings file. I guess this is an edge case so not a big problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants