Hi,

When running diff without options, removed lines are separated of
added ones by '^---$'. This pattern gets interpreted as diffRemoved
when it is not. I think the pattern can be classified as diffLine. If
I'm not interpreting it wrongly the attached patch fix this tiny bug.

Locale problem: The diff in languages other than English may generate
output that doesn't match the patterns for diffOnly, diffDiffer, etc.
because diff messages get translated in some languages. To fix this
for my locale (pt_BR.UTF-8) I've put in my
~/.vim/after/syntax/diff.vim the following lines:

syn match diffOnly      "^[A-Z].*"
syn match diffIdentical "^[A-Z].*"
syn match diffDiffer    "^[A-Z].*"
syn match diffBDiffer   "^[A-Z].*"
syn match diffIsA       "^[A-Z].*"
syn match diffNoEOL     "^[A-Z].*"
syn match diffCommon    "^[A-Z].*"

I repeated the same pattern because sometimes I use the terminal
emulator in English and the above patterns will still be fine. A more
general solution would be to define the above syntax elements first
using the pattern "^\S.*" and, then, define the other syntax elements.
This approach would have at least one shortcoming: the distinction
between diffOnly, diffidentical, etc. would be lost.

Best regards,

Jakson

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff -r 7d1044b27eb5 runtime/syntax/diff.vim
--- a/runtime/syntax/diff.vim	Mon Aug 02 23:06:46 2010 +0200
+++ b/runtime/syntax/diff.vim	Mon Aug 02 22:33:26 2010 -0300
@@ -26,6 +26,7 @@
 syn match diffLine	"^...@.*" contains=diffSubname
 syn match diffLine	"^\<\d\+\>.*"
 syn match diffLine	"^\*\*\*\*.*"
+syn match diffLine	"^---$"
 
 "Some versions of diff have lines like "#c#" and "#d#" (where # is a number)
 syn match diffLine	"^\d\+\(,\d\+\)\=[cda]\d\+\>.*"

Raspunde prin e-mail lui