Mercurial > vim
annotate runtime/ftplugin/git.vim @ 23697:19073a768852 v8.2.2390
patch 8.2.2390: Vim9: using positive offset is unexpected
Commit: https://github.com/vim/vim/commit/b3005ce191d27fd2f234df4969d5b58fda9c1940
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 22 17:51:06 2021 +0100
patch 8.2.2390: Vim9: using positive offset is unexpected
Problem: Vim9: using positive offset is unexpected.
Solution: Use int8_T instead of char. (James McCoy)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 22 Jan 2021 18:00:05 +0100 |
parents | 5c40013d45ee |
children |
rev | line source |
---|---|
1620 | 1 " Vim filetype plugin |
2 " Language: generic git output | |
2034 | 3 " Maintainer: Tim Pope <vimNOSPAM@tpope.org> |
18818 | 4 " Last Change: 2019 Dec 05 |
1620 | 5 |
6 " Only do this when not done yet for this buffer | |
7 if (exists("b:did_ftplugin")) | |
2202 | 8 finish |
1620 | 9 endif |
10 let b:did_ftplugin = 1 | |
11 | |
12 if !exists('b:git_dir') | |
18818 | 13 if expand('%:p') =~# '[\/]\.git[\/]modules[\/]\|:[\/][\/]\|^\a\a\+:' |
3465 | 14 " Stay out of the way |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
15 elseif expand('%:p') =~# '[\/]\.git[\/]worktrees' |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
4681
diff
changeset
|
16 let b:git_dir = matchstr(expand('%:p'),'.*\.git[\/]worktrees[\/][^\/]\+\>') |
3465 | 17 elseif expand('%:p') =~# '\.git\>' |
2202 | 18 let b:git_dir = matchstr(expand('%:p'),'.*\.git\>') |
19 elseif $GIT_DIR != '' | |
20 let b:git_dir = $GIT_DIR | |
21 endif | |
22 if (has('win32') || has('win64')) && exists('b:git_dir') | |
23 let b:git_dir = substitute(b:git_dir,'\\','/','g') | |
24 endif | |
1620 | 25 endif |
26 | |
27 if exists('*shellescape') && exists('b:git_dir') && b:git_dir != '' | |
2202 | 28 if b:git_dir =~# '/\.git$' " Not a bare repository |
29 let &l:path = escape(fnamemodify(b:git_dir,':h'),'\, ').','.&l:path | |
30 endif | |
31 let &l:path = escape(b:git_dir,'\, ').','.&l:path | |
32 let &l:keywordprg = 'git --git-dir='.shellescape(b:git_dir).' show' | |
1620 | 33 else |
2202 | 34 setlocal keywordprg=git\ show |
1620 | 35 endif |
2034 | 36 if has('gui_running') |
37 let &l:keywordprg = substitute(&l:keywordprg,'^git\>','git --no-pager','') | |
38 endif | |
1620 | 39 |
40 setlocal includeexpr=substitute(v:fname,'^[^/]\\+/','','') | |
41 let b:undo_ftplugin = "setl keywordprg< path< includeexpr<" |