kaste / Compare-Side-By-Side

Compare anything, side-by-side, in a split view
MIT License
19 stars 1 forks source link

Compare locks up Sublime 4? #7

Open LorenAmelang opened 5 months ago

LorenAmelang commented 5 months ago

I have /.config/sublime-text/Installed Packages/Compare Side-By-Side.sublime-package installed in Sublime 4. This has "just worked" in the past, and I never studied it much. Today any use of it locks up the Sublime interface forever, or at least several minutes, with a constant ~15% CPU load. Even with tiny files. It says it was updated today ???

I see /.config/sublime-text/Log, but it is empty and from what I see on the web the log files are only written after Sublime closes properly - which mine doesn't. Could that be true?

I also have /.config/sublime-text/Installed Packages/Origami.sublime-package installed, and it can actually compare the same files, but interleaved instead of side-by-side, which doesn't work for today's project. And once it is active, there seems no way to close its display pane short of quitting Sublime. Probably unrelated.

Is there some way to get more info?

LorenAmelang commented 5 months ago

Forgot to mention - the "Comparison results open in a new window" does not happen, the screen does not change at all when I try to trigger a compare.

This is on Arch Linux with Cinnamon, if that might matter.

kaste commented 5 months ago

The last release is from March 3. So you should have received no update today unless you did not restart Sublime within that period. "Origami" can't compare files as it is just a window/pane manager. This plugin could maybe hang for long lines (and very big files of course) as it relies on a python implementation to do the diff. I can imagine being catastrophic for long lines but I never tested it.

LorenAmelang commented 5 months ago

Tried some smaller files, worked for 1.7MB. A 13MB pair with only short lines (directory listings) locked up for 40+ minutes, with the system use shown in the

plugin_host for 40+ minutes

screenshot. No change from beginning to end... Have to minimize and remax Sublime for it to notice it is unresponsive.

Also... I seem to remember there being some highlight of changed lines in addition to the very dimly changed background behind the changed text. Am I imagining that? Spotting that background in a screenfull of text is difficult for my lousy vision! Can I change the visibility?

Diff pale highlight

I made "one intraline modification". Why does it always say one line added, one deleted?

kaste commented 5 months ago

This tool is built for small files as I said as it is implemented in Python only -- 13 MB is not big but huge, source code files seldomly are more than 100kB. For huge files we would need to call out to a c/rust library.

The colors are defined by your color scheme as described here: https://github.com/kaste/Compare-Side-By-Side/releases/tag/v1.22.0 An example config can be found here: https://github.com/kaste/Compare-Side-By-Side/issues/4#issuecomment-1974877718

The stats are misleading. "x intra-line modifications" is just a guess as we don't count all +--pairs as intra-line modifications. The lines have to be similar enough. Maybe we should remove that stat.

LorenAmelang commented 5 months ago

Guess my age is showing, my ancient code files are way over 100kB... But I get that Python is not up to 13MB. Maybe you could peek at the file sizes as you begin, and warn us if the little python is likely to choke on them?

Thanks for the color info and especially the example! That's nice enough I didn't even hack on it.

I'd vote for "x intra-line modifications" counting lines that are recognizably similar in both files, and insert/delete for those that can't be mated to the other file. But exclusive - anything that fits in intra-line doesn't count in insert/delete. But I'd be happy with intra-line being removed if it is really too imprecise.

Again, thanks for making my life easier!