mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 11:33:48 -05:00
Extract has_repo_path() function
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
let s:t_string = type('')
|
|
||||||
|
|
||||||
" Primary functions {{{
|
" Primary functions {{{
|
||||||
|
|
||||||
function! gitgutter#all(force) abort
|
function! gitgutter#all(force) abort
|
||||||
@@ -156,11 +154,7 @@ function! gitgutter#setup_maps()
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:setup_path(bufnr, continuation)
|
function! s:setup_path(bufnr, continuation)
|
||||||
let p = gitgutter#utility#repo_path(a:bufnr, 0)
|
if gitgutter#utility#has_repo_path(a:bufnr) | return | endif
|
||||||
|
|
||||||
if type(p) == s:t_string && !empty(p) " if path is known
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
|
|
||||||
return gitgutter#utility#set_repo_path(a:bufnr, a:continuation)
|
return gitgutter#utility#set_repo_path(a:bufnr, a:continuation)
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -105,6 +105,10 @@ function! gitgutter#utility#system(cmd, ...) abort
|
|||||||
return output
|
return output
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! gitgutter#utility#has_repo_path(bufnr)
|
||||||
|
return index(['', -1, -2], gitgutter#utility#repo_path(a:bufnr, 0)) == -1
|
||||||
|
endfunction
|
||||||
|
|
||||||
" Path of file relative to repo root.
|
" Path of file relative to repo root.
|
||||||
"
|
"
|
||||||
" * empty string - not set
|
" * empty string - not set
|
||||||
|
|||||||
Reference in New Issue
Block a user