Skip to content

Commit e16584a

Browse files
committed
! should work forcely. Close mattn#175, mattn#180
1 parent c4aba40 commit e16584a

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

autoload/gist.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ function! s:GistPostBuffers(private, desc, anonymous) abort
688688
return loc
689689
endfunction
690690

691-
function! gist#Gist(count, line1, line2, ...) abort
691+
function! gist#Gist(count, bang, line1, line2, ...) abort
692692
redraw
693693
let bufname = bufname('%')
694694
" find GistID: in content , then we should just update
@@ -709,7 +709,9 @@ function! gist#Gist(count, line1, line2, ...) abort
709709
echohl ErrorMsg | echomsg 'You don''t have github account. read '':help gist-vim-setup''.' | echohl None
710710
return
711711
endif
712-
if bufname =~# bufnamemx
712+
if a:bang == '!'
713+
let gistidbuf = ''
714+
elseif bufname =~# bufnamemx
713715
let gistidbuf = matchstr(bufname, bufnamemx)
714716
elseif exists('b:gist') && has_key(b:gist, 'id')
715717
let gistidbuf = b:gist['id']

plugin/gist.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ function! s:CompleteArgs(arg_lead,cmdline,cursor_pos)
1818
\ ]
1919
endfunction
2020

21-
command! -nargs=? -range=% -complete=customlist,s:CompleteArgs Gist :call gist#Gist(<count>, <line1>, <line2>, <f-args>)
21+
command! -nargs=? -range=% -bang -complete=customlist,s:CompleteArgs Gist :call gist#Gist(<count>, "<bang>", <line1>, <line2>, <f-args>)
2222

2323
" vim:set et:

0 commit comments

Comments
 (0)