[TxMt] Re: Combined diff and source code highlighting

Allan Odgaard mailinglist at textmate.org
Sun Jan 18 13:07:54 UTC 2015


On 16 Jan 2015, at 3:55, Jacob Carlborg wrote:

> Would it be possible to some how combine the diff highlighting with 
> the highlighting of a source code? I know that it's possible to insert 
> other grammars in a grammar but I was thinking of a general solution 
> that doesn't require changing every existing grammar to add diff 
> support.

The problem is that you only have a subset of the file in a diff and 
TextMate’s grammars will often work on larger structures.

Take the JSON grammar where we highlight misplaced commas, such rules 
can’t work when we just get a random line of a JSON file.

For proper diff highlighting, we need to highlight the two source files 
separately, then grab the highlighted subsets for the diff.


More information about the textmate mailing list