Mercurial > vim
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 |
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<" |