annotate runtime/ftplugin/git.vim @ 22448:5e287462487e v8.2.1772

patch 8.2.1772: cannot use CTRL-W <Down> to move out of a terminal window Commit: https://github.com/vim/vim/commit/f43e7ac4eee22dbb26fc069ec9a3d1598ec8dfe9 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 29 21:23:25 2020 +0200 patch 8.2.1772: cannot use CTRL-W <Down> to move out of a terminal window Problem: Cannot use CTRL-W <Down> to move out of a terminal window. Solution: Use special_to_buf() instead of mb_char2bytes(). (closes https://github.com/vim/vim/issues/7045)
author Bram Moolenaar <Bram@vim.org>
date Tue, 29 Sep 2020 21:30:03 +0200
parents 5c40013d45ee
children
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>
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
4 " Last Change: 2019 Dec 05
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
5
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
6 " Only do this when not done yet for this buffer
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
7 if (exists("b:did_ftplugin"))
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
8 finish
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
9 endif
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
10 let b:did_ftplugin = 1
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
11
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
12 if !exists('b:git_dir')
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
13 if expand('%:p') =~# '[\/]\.git[\/]modules[\/]\|:[\/][\/]\|^\a\a\+:'
3465
161d01cbb165 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
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
161d01cbb165 Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
17 elseif expand('%:p') =~# '\.git\>'
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
18 let b:git_dir = matchstr(expand('%:p'),'.*\.git\>')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
19 elseif $GIT_DIR != ''
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
20 let b:git_dir = $GIT_DIR
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
21 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
22 if (has('win32') || has('win64')) && exists('b:git_dir')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
23 let b:git_dir = substitute(b:git_dir,'\\','/','g')
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
24 endif
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
25 endif
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
26
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
27 if exists('*shellescape') && exists('b:git_dir') && b:git_dir != ''
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
28 if b:git_dir =~# '/\.git$' " Not a bare repository
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
29 let &l:path = escape(fnamemodify(b:git_dir,':h'),'\, ').','.&l:path
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
30 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
31 let &l:path = escape(b:git_dir,'\, ').','.&l:path
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
32 let &l:keywordprg = 'git --git-dir='.shellescape(b:git_dir).' show'
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
33 else
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents: 2034
diff changeset
34 setlocal keywordprg=git\ show
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
35 endif
2034
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1698
diff changeset
36 if has('gui_running')
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1698
diff changeset
37 let &l:keywordprg = substitute(&l:keywordprg,'^git\>','git --no-pager','')
7bc41231fbc7 Update runtime files.
Bram Moolenaar <bram@zimbu.org>
parents: 1698
diff changeset
38 endif
1620
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
39
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
40 setlocal includeexpr=substitute(v:fname,'^[^/]\\+/','','')
73fe8baea242 updated for version 7.2a
vimboss
parents:
diff changeset
41 let b:undo_ftplugin = "setl keywordprg< path< includeexpr<"