winmerge icon indicating copy to clipboard operation
winmerge copied to clipboard

winmerge-settings.ini corrupted

Open dcog989 opened this issue 9 months ago • 5 comments

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?

dcog989 avatar Mar 23 '25 18:03 dcog989

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.

sdottaka avatar Mar 24 '25 13:03 sdottaka

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?

dcog989 avatar Mar 24 '25 14:03 dcog989

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

sdottaka avatar Mar 24 '25 23:03 sdottaka

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?

dcog989 avatar Mar 25 '25 10:03 dcog989