motiejus/dotfiles

Unnamed repository; edit this file 'description' to name the repository.
git clone https://git.jakstys.lt/motiejus/dotfiles.git
Log | Tree | Refs | README | LICENSE

commit 1651cd7f2031682e5e54d1f9bab48a0b33ffca07 (tree)
parent 630ecc8c3a57cb187152f72a0403ed60b8f12a82
Author: Tim Pope <code@tpope.net>
Date:   Mon, 13 Sep 2021 16:58:42 -0400

Extract helper to determine PTY availability

I constantly have to ask about this to troubleshoot bug reports, so make
it easier to determine.

Also rename g:fugitive_pty to make it clearer that it's not a preference
but a debugging tool.

Diffstat:
Mautoload/fugitive.vim | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim @@ -3433,6 +3433,11 @@ augroup fugitive_job \ endfor augroup END +function! fugitive#CanPty() abort + return get(g:, 'fugitive_pty_debug_override', + \ has('unix') && !has('win32unix') && (has('patch-8.0.0744') || has('nvim')) && fugitive#GitVersion() !~# '\.windows\>') +endfunction + function! fugitive#PagerFor(argv, ...) abort let args = a:argv if empty(args) @@ -3609,7 +3614,7 @@ function! fugitive#Command(line1, line2, range, bang, mods, arg) abort endif if s:run_jobs call extend(env, {'COLUMNS': '' . (&columns - 1)}, 'keep') - let state.pty = allow_pty && get(g:, 'fugitive_pty', has('unix') && !has('win32unix') && (has('patch-8.0.0744') || has('nvim')) && fugitive#GitVersion() !~# '\.windows\>') + let state.pty = allow_pty && fugitive#CanPty() if !state.pty let args = s:AskPassArgs(dir) + args endif