Closed WolfgangFahl closed 2 years ago
Related code is on org/jmeld/ui/JMeldPanel.java:201
that logic doesn't have much sense, yes.
There new logic could be implemented, what I don't see is what is the purpose on open an empty file against another one.
Is this issue trying to mimic the open blank comparison from meld? I use it a lot, so I'm fine with implement it.
GUI do not allow non existing files to be compared, so let's focus first on CLI where it is avaliable:
CLI: Something like --blank-comparison
(a cli command parser is needed for that, like apache CLI tool but any of https://stackoverflow.com/questions/367706/how-do-i-parse-command-line-arguments-in-java will do too) non option arguments will represent files.
GUI: A button for start blank comparison from GUI could be the easy way to implement it. That maybe could require to replace the combo boxes to be editable (to allow new files of empty arguments)
About red diff, I think that's ok. From diff perspective, one buffer has content and the other don't, so red shows that content is missing in the other buffer:
if you have a visual mockup about your ideas please upload, but this to me is ok
Definitely there're two things to fix here:
You should be able to clean file or directory selected (probably allow to edit selected file)
Blank comparison should be fine, one or two should be ok
A plus, three way diff should be supported too
Now is possible to do blank comparison.
Three way still not enabled
Save is not enabled, probably checking if path do not exists it can be enabled, if it is empty I think disabled is correct
Currently if an empty file name is passed to jMeld the version control comparison is initiated which seems also to be a bit buggy.
I had error messages when I tried this (which i unfortunately did not record since that is no my usecase).
The user interface is different and things get a bit awkward in my usecase. I'd rather compare to an "empty file".
When creating an empty file with File.createTempFile the name of the file is shown as something like empty80849768099353... and the counterpart is all "red".
I'd rather label one of the files as "empty" and decide that the color scheme should be different in this case since it is not such a big deal if the counter part is completly missing as in the case of a new file that is compared to a non existing file.
How could such a behavior be accomplished with JMeld?