Skip to content

Commit c1e6b34

Browse files
committed
gist_token support for direct token set
1 parent e485c6c commit c1e6b34

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

autoload/gist.vim

+3-1
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,9 @@ function! s:GistGetAuthHeader() abort
961961
return printf('basic %s', webapi#base64#b64encode(g:github_user.':'.password))
962962
endif
963963
let auth = ''
964-
if filereadable(s:gist_token_file)
964+
if !empty(get(g:, 'gist_token', $GITHUB_TOKEN))
965+
let auth = 'token ' . get(g:, 'gist_token', $GITHUB_TOKEN)
966+
elseif filereadable(s:gist_token_file)
965967
let str = join(readfile(s:gist_token_file), '')
966968
if type(str) == 1
967969
let auth = str

0 commit comments

Comments
 (0)