mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-14 06:13:51 -05:00
Fix upwards navigation on "-"
This commit is contained in:
@@ -2956,8 +2956,8 @@ function! s:ContainingCommit() abort
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:NavigateUp(count) dict abort
|
function! s:NavigateUp(count) abort
|
||||||
let rev = self.rev()
|
let rev = s:buffer().rev()
|
||||||
let c = a:count
|
let c = a:count
|
||||||
while c
|
while c
|
||||||
if rev =~# '^[/:]$'
|
if rev =~# '^[/:]$'
|
||||||
@@ -2986,7 +2986,7 @@ function! fugitive#MapJumps(...) abort
|
|||||||
nnoremap <buffer> <silent> o :<C-U>exe <SID>GF("split")<CR>
|
nnoremap <buffer> <silent> o :<C-U>exe <SID>GF("split")<CR>
|
||||||
nnoremap <buffer> <silent> S :<C-U>exe <SID>GF("vsplit")<CR>
|
nnoremap <buffer> <silent> S :<C-U>exe <SID>GF("vsplit")<CR>
|
||||||
nnoremap <buffer> <silent> O :<C-U>exe <SID>GF("tabedit")<CR>
|
nnoremap <buffer> <silent> O :<C-U>exe <SID>GF("tabedit")<CR>
|
||||||
nnoremap <buffer> <silent> - :<C-U>exe <SID>Edit('edit',0,'',<SID>NavigateUp(v:count1))<Bar> if fugitive#buffer().type('tree')<Bar>call search('^'.escape(expand('#:t'),'.*[]~\').'/\=$','wc')<Bar>endif<CR>
|
nnoremap <buffer> <silent> - :<C-U>exe <SID>Edit('edit',0,'',<SID>NavigateUp(v:count1))<Bar> if getline(1) =~# '^tree \x\{40\}$' && empty(getline(2))<Bar>call search('^'.escape(expand('#:t'),'.*[]~\').'/\=$','wc')<Bar>endif<CR>
|
||||||
nnoremap <buffer> <silent> P :<C-U>exe <SID>Edit('edit',0,'',<SID>ContainingCommit().'^'.v:count1.<SID>Relative(':'))<CR>
|
nnoremap <buffer> <silent> P :<C-U>exe <SID>Edit('edit',0,'',<SID>ContainingCommit().'^'.v:count1.<SID>Relative(':'))<CR>
|
||||||
nnoremap <buffer> <silent> ~ :<C-U>exe <SID>Edit('edit',0,'',<SID>ContainingCommit().'~'.v:count1.<SID>Relative(':'))<CR>
|
nnoremap <buffer> <silent> ~ :<C-U>exe <SID>Edit('edit',0,'',<SID>ContainingCommit().'~'.v:count1.<SID>Relative(':'))<CR>
|
||||||
nnoremap <buffer> <silent> C :<C-U>exe <SID>Edit('edit',0,'',<SID>ContainingCommit())<CR>
|
nnoremap <buffer> <silent> C :<C-U>exe <SID>Edit('edit',0,'',<SID>ContainingCommit())<CR>
|
||||||
|
|||||||
Reference in New Issue
Block a user