annotate runtime/ftplugin/git.vim @ 4389:736b8e18a3bc v7.3.943

updated for version 7.3.943 Problem: Python: Negative indices were failing. Solution: Fix negative indices. Add tests. (ZyX)
author Bram Moolenaar <bram@vim.org>
date Sun, 12 May 2013 21:16:23 +0200
parents 161d01cbb165
children 2eb30f341e8d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
1 " Vim filetype plugin
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
2 " Language: generic git output
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1698
diff changeset
3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org>
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
4
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
5 " Only do this when not done yet for this buffer
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
6 if (exists("b:did_ftplugin"))
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
7 finish
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
8 endif
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
9 let b:did_ftplugin = 1
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
10
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
11 if !exists('b:git_dir')
3465
161d01cbb165 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
12 if expand('%:p') =~# '[\/]\.git[\/]modules[\/]'
161d01cbb165 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
13 " Stay out of the way
161d01cbb165 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
14 elseif expand('%:p') =~# '\.git\>'
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
15 let b:git_dir = matchstr(expand('%:p'),'.*\.git\>')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
16 elseif $GIT_DIR != ''
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
17 let b:git_dir = $GIT_DIR
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
18 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
19 if (has('win32') || has('win64')) && exists('b:git_dir')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
20 let b:git_dir = substitute(b:git_dir,'\\','/','g')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
21 endif
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
22 endif
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
23
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
24 if exists('*shellescape') && exists('b:git_dir') && b:git_dir != ''
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
25 if b:git_dir =~# '/\.git$' " Not a bare repository
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
26 let &l:path = escape(fnamemodify(b:git_dir,':h'),'\, ').','.&l:path
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
27 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
28 let &l:path = escape(b:git_dir,'\, ').','.&l:path
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
29 let &l:keywordprg = 'git --git-dir='.shellescape(b:git_dir).' show'
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
30 else
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
31 setlocal keywordprg=git\ show
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
32 endif
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1698
diff changeset
33 if has('gui_running')
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1698
diff changeset
34 let &l:keywordprg = substitute(&l:keywordprg,'^git\>','git --no-pager','')
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1698
diff changeset
35 endif
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
36
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
37 setlocal includeexpr=substitute(v:fname,'^[^/]\\+/','','')
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
38 let b:undo_ftplugin = "setl keywordprg< path< includeexpr<"