Mercurial > vim-lawrencium
annotate syntax/hgcommit.vim @ 113:8718e6dbea1e
Fix a bug with `:Hgstatus` showing diff summaries in its own window.
This could happen when the user would commit from the status window, and
do a `:Hgstatusvdiffsum` right away. It wouldn't find the previous window
because it would be gone (the commit message window), so it would split the
status window itself, which is often too small.
Now Lawrencium tries to avoid picking the status window itself, and will just
find any other window instead.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 27 Dec 2014 17:58:36 -0800 |
parents | adc267e2f0f4 |
children |
rev | line source |
---|---|
7
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
1 " Vim syntax file |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
2 " Language: hg commit file |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
3 " Maintainer: Pierre Bourdon <delroth@gmail.com> |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
4 " Filenames: ^hg-editor-*.txt |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
5 " Last Change: 2010 Jun 13 |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
6 |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
7 " Some parts of the code by Dan LaMotte <lamotte85@gmail.com> |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
8 |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
9 if exists("b:current_syntax") |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
10 finish |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
11 endif |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
12 |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
13 syn case match |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
14 syn sync minlines=50 |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
15 |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
16 if has("spell") |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
17 syn spell toplevel |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
18 endif |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
19 |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
20 syn match hgcommitFirstline "\%^.*" nextgroup=hgcommitBlank skipnl |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
21 syn match hgcommitSummary "^.\{0,78\}" contained containedin=hgcommitFirstline nextgroup=hgcommitOverflow contains=@Spell |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
22 syn match hgcommitOverflow ".*" contained contains=@Spell |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
23 syn match hgcommitBlank "^HG:\@!.*" contained contains=@Spell |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
24 |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
25 syn match hgcommitComment "^HG:.*" |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
26 |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
27 syn match hgcommitOnBranch "\%(^HG: \)\@<=\<branch\> '" contained containedin=hgcommitComment nextgroup=hgcommitBranch |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
28 syn match hgcommitBranch "[^']\+" contained |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
29 syn match hgcommitAdded "\%(^HG: \)\@<=\<added\>" contained containedin=hgcommitComment nextgroup=hgcommitFile |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
30 syn match hgcommitChanged "\%(^HG: \)\@<=\<changed\>" contained containedin=hgcommitComment nextgroup=hgcommitFile |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
31 syn match hgcommitRemoved "\%(^HG: \)\@<=\<removed\>" contained containedin=hgcommitComment nextgroup=hgcommitFile |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
32 syn match hgcommitFile " \S\+" contained containedin=hgcommitAdded,hgcommitChanged |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
33 |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
34 hi def link hgcommitSummary Keyword |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
35 hi def link hgcommitOverflow Error |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
36 hi def link hgcommitBlank Error |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
37 |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
38 hi def link hgcommitComment Comment |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
39 hi def link hgcommitOnBranch Comment |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
40 hi def link hgcommitBranch Special |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
41 hi def link hgcommitOnBranchEnd Comment |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
42 hi def link hgcommitAdded Type |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
43 hi def link hgcommitChanged Type |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
44 hi def link hgcommitRemoved Type |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
45 hi def link hgcommitFile Constant |
adc267e2f0f4
Added syntax highlighting for hgstatus window.
Ludovic Chabant <ludovic@chabant.com>
parents:
diff
changeset
|
46 |