New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix syntax highlighting #467

merged 2 commits into from Jun 27, 2015


None yet
2 participants

living180 commented Jun 26, 2015

Fix two regressions in diff syntax highlighting introduced by PR #466:

  • Diffs of unmerged files were being highlighted using the diff header color, because the regular expression for detecting a diff hunk header did not match the diff hunk header for unmerged files. Update the regular expression to match both normal and unmerged diff hunk headers.
  • Diffs of submodules were being highlighted using the diff header color. Detect submodule diffs and do not apply any syntax highlighting to them.

living180 added some commits Jun 26, 2015

widgets/diff: fix unmerged syntax highlighting
The regex used to detect the start of a diff hunk did not match the
header used when viewing the diff of an unmerged file.  Update the regex
so that it matches both kinds of diff hunk headers.

Signed-off-by: Daniel Harding <>
widgets/diff: fix submodule syntax highlighting
When viewing the diff for a submodule, it should not have any syntax
highlighting applied, but instead it was being highlighted using the
diff header color.  Fix DiffSyntaxHighlighter to recoginize a submodule
diff and to not perform any syntax highlighting in that case.

Signed-off-by: Daniel Harding <>

davvid added a commit that referenced this pull request Jun 27, 2015

Merge pull request #467 from living180/fix_syntax_highlighting
diff: handle highlighting submodule and merge diff headers

Signed-off-by: David Aguilar <>

@davvid davvid merged commit 397ac76 into git-cola:master Jun 27, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed

@living180 living180 deleted the living180:fix_syntax_highlighting branch Jun 29, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment