Skip to content

Commit d652eff

Browse files
committed
Merge branch 'master' into feature/allow-default-private
2 parents f984976 + 0f40747 commit d652eff

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

gist.vim.vimup

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ script_name: Gist.vim
22
script_id: '2423'
33
script_type: utility
44
script_package: plugin/gist.vim
5-
script_version: '4.8'
5+
script_version: '4.9'
66
required_vim_version: '7.0'
77
summary: vimscript for gist
88

@@ -110,6 +110,12 @@ install_details: |
110110
4. you'll see it at following of 'API Token'.
111111
112112
versions:
113+
- '4.9': |
114+
fix: don't add new line after "Done: xxx".
115+
fix: show WHY FAILED' when failed to post.
116+
add: support for :OpenBrowser.
117+
add: new option 'gist_curl_options'.
118+
113119
- '4.8': |
114120
This is an upgrade for Gist.vim: fixed: can't open private gist with ":Gist XXXXX".
115121

plugin/gist.vim

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"=============================================================================
22
" File: gist.vim
33
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
4-
" Last Change: 01-Apr-2011.
4+
" Last Change: 15-Apr-2011.
55
" Version: 4.9
66
" WebPage: http://github.com/mattn/gist-vim
77
" License: BSD
@@ -97,6 +97,16 @@
9797
"
9898
" let g:gist_show_privates = 1
9999
"
100+
" * if don't you want to copy URL of the post...
101+
"
102+
" let g:gist_put_url_to_clipboard_after_post = 0
103+
"
104+
" or if you want to copy URL and add linefeed at the last of URL,
105+
"
106+
" let g:gist_put_url_to_clipboard_after_post = 2
107+
"
108+
" default value is 1.
109+
"
100110
" Thanks:
101111
" MATSUU Takuto:
102112
" removed carriage return
@@ -392,6 +402,7 @@ function! s:GistUpdate(user, token, content, gistid, gistnm)
392402
let location = substitute(location, '^[^:]\+: ', '', '')
393403
if len(location) > 0 && location =~ '^\(http\|https\):\/\/gist\.github\.com\/'
394404
setlocal nomodified
405+
redraw
395406
echo 'Done: '.location
396407
else
397408
let message = matchstr(headers, '^Status: ')
@@ -484,6 +495,7 @@ function! s:GistDelete(user, token, gistid)
484495
if len(token) > 0
485496
let res = s:GistGetPage('https://gist.github.com/delete/'.a:gistid, a:user, '_method=delete&authenticity_token='.token, '')
486497
if len(res.content) > 0
498+
redraw
487499
echo 'Done: '
488500
else
489501
let message = matchstr(res.header, '^Status: ')
@@ -579,6 +591,7 @@ function! s:GistPost(user, token, content, private)
579591
let location = matchstr(headers, '^Location: ')
580592
let location = substitute(location, '^[^:]\+: ', '', '')
581593
if len(location) > 0 && location =~ '^\(http\|https\):\/\/gist\.github\.com\/'
594+
redraw
582595
echo 'Done: '.location
583596
else
584597
let message = matchstr(headers, '^Status: ')
@@ -641,6 +654,7 @@ function! s:GistPostBuffers(user, token, private)
641654
let res = matchstr(split(res, '\(\r\?\n\|\r\n\?\)'), '^Location: ')
642655
let res = substitute(res, '^.*: ', '', '')
643656
if len(res) > 0 && res =~ '^\(http\|https\):\/\/gist\.github\.com\/'
657+
redraw
644658
echo 'Done: '.res
645659
else
646660
echoerr 'Post failed'
@@ -784,9 +798,12 @@ function! Gist(line1, line2, ...)
784798
call system(cmd)
785799
endif
786800
endif
787-
if g:gist_put_url_to_clipboard_after_post == 1
801+
if g:gist_put_url_to_clipboard_after_post > 0
802+
if g:gist_put_url_to_clipboard_after_post == 2
803+
let url = url . "\n"
804+
endif
788805
if exists('g:gist_clip_command')
789-
call system('echo '.url.' | '.g:gist_clip_command)
806+
call system(g:gist_clip_command, url)
790807
elseif has('unix') && !has('xterm_clipboard')
791808
let @" = url
792809
else

0 commit comments

Comments
 (0)