Sublime Forum

How do I increase context for diffs

#1

I’m using ST3 (3207) on Ubuntu 18.04.2 LTS. I frequently use the diff feature ie. select two files in the project/folder sidebar > Diff Files…

Sublime Text collapses a lot of the context though. Useful sometimes, but other times (eg. large files with little differences) I just want to see the whole lot of common text with a few red/green lines here and there.

How can I increase the diff context?

0 Likes

#2

There is no direct setting that controls that, but the code that does the diffing is in Diff/diff.py.

You can use PackageResourceViewer to open that resource file and modified the calls to difflib.unified_diff to increase the context size from the default of 3 to whatever you want by adding n=12 (or whatever number) as the last argument to the call.

If you’re not sure how to do that we can provide more detailed instructions.

0 Likes