@@ -483,6 +483,10 @@ endfunction
483
483
function ! s: GistUpdate (content, gistid, gistnm, desc) abort
484
484
let gist = { " id" : a: gistid , " files" : {}, " description" : " " ," public" : function (' webapi#json#true' ) }
485
485
if exists (' b:gist' )
486
+ if has_key (b: gist , ' filename' ) && len (a: gistnm ) > 0
487
+ let gist.files [b: gist .filename] = { " content" : ' ' , " filename" : b: gist .filename }
488
+ let b: gist .filename = a: gistnm
489
+ endif
486
490
if has_key (b: gist , ' private' ) && b: gist .private | let gist[' public' ] = function (' webapi#json#false' ) | endif
487
491
if has_key (b: gist , ' description' ) | let gist[' description' ] = b: gist .description | endif
488
492
if has_key (b: gist , ' filename' ) | let filename = b: gist .filename | endif
@@ -761,8 +765,10 @@ function! gist#Gist(count, bang, line1, line2, ...) abort
761
765
elseif arg = ~# ' ^\(-d\|--delete\)$\C' && gistidbuf !=# ' '
762
766
let gistid = gistidbuf
763
767
let deletepost = 1
764
- elseif arg = ~# ' ^\(-e\|--edit\)$\C' && gistidbuf !=# ' '
765
- let gistid = gistidbuf
768
+ elseif arg = ~# ' ^\(-e\|--edit\)$\C'
769
+ if gistidbuf !=# ' '
770
+ let gistid = gistidbuf
771
+ endif
766
772
let editpost = 1
767
773
elseif arg = ~# ' ^\(+1\|--star\)$\C' && gistidbuf !=# ' '
768
774
let auth = s: GistGetAuthHeader ()
0 commit comments