Skip to content

Commit 5a07c59

Browse files
tsuyoshichoallex
authored andcommitted
gist_token support for direct token set
1 parent 2a30007 commit 5a07c59

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

autoload/gist.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,9 @@ function! s:GistGetAuthHeader() abort
967967
return printf('basic %s', webapi#base64#b64encode(g:github_user.':'.password))
968968
endif
969969
let auth = ''
970-
if filereadable(s:gist_token_file)
970+
if !empty(get(g:, 'gist_token', $GITHUB_TOKEN))
971+
let auth = 'token ' . get(g:, 'gist_token', $GITHUB_TOKEN)
972+
elseif filereadable(s:gist_token_file)
971973
let str = join(readfile(s:gist_token_file), '')
972974
if type(str) == 1
973975
let auth = str

0 commit comments

Comments
 (0)