File tree Expand file tree Collapse file tree 1 file changed +32
-5
lines changed Expand file tree Collapse file tree 1 file changed +32
-5
lines changed Original file line number Diff line number Diff line change @@ -373,12 +373,39 @@ function! s:GistGet(gistid, clipboard) abort
373
373
setlocal modifiable
374
374
else
375
375
if num_file == 1
376
- silent only !
377
- endif
378
- if get (g: , ' gist_list_vsplit' , 0 )
379
- exec ' silent noautocmd rightbelow vnew'
376
+ if get (g: , ' gist_edith_with_buffers' , 0 )
377
+ let found = -1
378
+ for wnr in range (1 , winnr (' $' ))
379
+ let bnr = winbufnr (wnr)
380
+ if bnr != -1 && ! empty (getbufvar (bnr, ' gist' ))
381
+ let found = wnr
382
+ break
383
+ endif
384
+ endfor
385
+ if found != -1
386
+ exe found ' wincmd w'
387
+ setlocal modifiable
388
+ else
389
+ if get (g: , ' gist_list_vsplit' , 0 )
390
+ exec ' silent noautocmd rightbelow vnew'
391
+ else
392
+ exec ' silent noautocmd rightbelow new'
393
+ endif
394
+ endif
395
+ else
396
+ silent only !
397
+ if get (g: , ' gist_list_vsplit' , 0 )
398
+ exec ' silent noautocmd rightbelow vnew'
399
+ else
400
+ exec ' silent noautocmd rightbelow new'
401
+ endif
402
+ endif
380
403
else
381
- exec ' silent noautocmd rightbelow new'
404
+ if get (g: , ' gist_list_vsplit' , 0 )
405
+ exec ' silent noautocmd rightbelow vnew'
406
+ else
407
+ exec ' silent noautocmd rightbelow new'
408
+ endif
382
409
endif
383
410
setlocal noswapfile
384
411
silent exec ' noautocmd file' s: bufprefix .a: gistid .' /' .fnameescape (filename)
You can’t perform that action at this time.
0 commit comments