File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 2
2
" It scrolls to "Changes" in the buffer, splits the window etc.
3
3
" This allows for reviewing the diff (from `git commit -v`) while editing the
4
4
" commit message easily.
5
- if get (b: , ' fugitive_type' , ' ' ) !=# ' index' " Skip with fugitive :Gstatus
5
+ if has_key (b: , ' b:fugitive_commit_arguments' )
6
+ \ || get (b: , ' fugitive_type' , ' ' ) !=# ' index' " Skip with fugitive :Gstatus
7
+ if ! (tabpagenr (' $' ) == 1 && winnr (' $' ) == 1 )
8
+ " Only with single windows (for Q mapping at least).
9
+ finish
10
+ endif
6
11
let b: my_auto_scrolloff= 0
7
12
setlocal foldmethod = syntax foldlevel = 1 nohlsearch spell spl = de,en sw = 2 scrolloff = 0
8
13
9
14
augroup vimrc_gitcommit
10
15
autocmd BufWinEnter <buffer>
11
- \ exe ' g/^# \(Changes not staged\|Untracked files\)/norm! zc'
12
- \ | silent ! exe ' ?^# Changes to be committed:'
16
+ \ exe ' keeppatterns g/^# \(Changes not staged\|Untracked files\)/norm! zc'
17
+ \ | silent ! exe ' keeppatterns ?^# Changes to be committed:'
13
18
\ | exe ' norm! zt'
14
19
\ | belowright exe max ([5 , min ([10 , (winheight (0 ) / 3 )])]).' split'
15
20
\ | exe ' normal! gg'
You can’t perform that action at this time.
0 commit comments