mirror of
https://github.com/airblade/vim-gitgutter.git
synced 2025-11-08 19:43:47 -05:00
@@ -1,5 +1,5 @@
|
|||||||
function! gitgutter#utility#supports_overscore_sign()
|
function! gitgutter#utility#supports_overscore_sign()
|
||||||
if s:windows()
|
if gitgutter#utility#windows()
|
||||||
return &encoding ==? 'utf-8'
|
return &encoding ==? 'utf-8'
|
||||||
else
|
else
|
||||||
return &termencoding ==? &encoding || &termencoding == ''
|
return &termencoding ==? &encoding || &termencoding == ''
|
||||||
@@ -161,7 +161,7 @@ function! s:set_path(bufnr, path)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! gitgutter#utility#cd_cmd(bufnr, cmd) abort
|
function! gitgutter#utility#cd_cmd(bufnr, cmd) abort
|
||||||
let cd = s:unc_path(a:bufnr) ? 'pushd' : (s:windows() ? 'cd /d' : 'cd')
|
let cd = s:unc_path(a:bufnr) ? 'pushd' : (gitgutter#utility#windows() ? 'cd /d' : 'cd')
|
||||||
return cd.' '.s:dir(a:bufnr).' && '.a:cmd
|
return cd.' '.s:dir(a:bufnr).' && '.a:cmd
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -205,6 +205,6 @@ function! s:strip_trailing_new_line(line) abort
|
|||||||
return substitute(a:line, '\n$', '', '')
|
return substitute(a:line, '\n$', '', '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:windows()
|
function! gitgutter#utility#windows()
|
||||||
return has('win64') || has('win32') || has('win16')
|
return has('win64') || has('win32') || has('win16')
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -76,6 +76,14 @@ call gitgutter#highlight#define_sign_column_highlight()
|
|||||||
call gitgutter#highlight#define_highlights()
|
call gitgutter#highlight#define_highlights()
|
||||||
call gitgutter#highlight#define_signs()
|
call gitgutter#highlight#define_signs()
|
||||||
|
|
||||||
|
" Prevent infinite loop where:
|
||||||
|
" - executing a job in the foreground launches a new window which takes the focus;
|
||||||
|
" - when the job finishes, focus returns to gvim;
|
||||||
|
" - the FocusGained event triggers a new job (see below).
|
||||||
|
if gitgutter#utility#windows() && !gitgutter#async#available()
|
||||||
|
set noshelltemp
|
||||||
|
endif
|
||||||
|
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
" Primary functions {{{
|
" Primary functions {{{
|
||||||
|
|||||||
Reference in New Issue
Block a user