Permalink
Browse files

Merge branch 'master' into feature/better-docs

Conflicts:
	plugin/gist.vim
  • Loading branch information...
AD7six committed Apr 16, 2011
2 parents 1c59257 + 0f40747 commit 92254de42d977984ac14abf0e0407df127ba99b3
Showing with 27 additions and 4 deletions.
  1. +7 −1 gist.vim.vimup
  2. +20 −3 plugin/gist.vim
View
@@ -2,7 +2,7 @@ script_name: Gist.vim
script_id: '2423'
script_type: utility
script_package: plugin/gist.vim
-script_version: '4.8'
+script_version: '4.9'
required_vim_version: '7.0'
summary: vimscript for gist
@@ -110,6 +110,12 @@ install_details: |
4. you'll see it at following of 'API Token'.
versions:
+- '4.9': |
+ fix: don't add new line after "Done: xxx".
+ fix: show WHY FAILED' when failed to post.
+ add: support for :OpenBrowser.
+ add: new option 'gist_curl_options'.
+
- '4.8': |
This is an upgrade for Gist.vim: fixed: can't open private gist with ":Gist XXXXX".
View
@@ -1,7 +1,7 @@
"=============================================================================
" File: gist.vim
" Author: Yasuhiro Matsumoto <mattn.jp@gmail.com>
-" Last Change: 01-Apr-2011
+" Last Change: 15-Apr-2011
" Version: 4.9
" WebPage: http://github.com/mattn/gist-vim
" License: BSD
@@ -98,6 +98,16 @@
"
" let g:gist_show_privates = 1
"
+" * if don't you want to copy URL of the post...
+"
+" let g:gist_put_url_to_clipboard_after_post = 0
+"
+" or if you want to copy URL and add linefeed at the last of URL,
+"
+" let g:gist_put_url_to_clipboard_after_post = 2
+"
+" default value is 1.
+"
" Thanks:
" MATSUU Takuto:
" removed carriage return
@@ -389,6 +399,7 @@ function! s:GistUpdate(user, token, content, gistid, gistnm)
let location = substitute(location, '^[^:]\+: ', '', '')
if len(location) > 0 && location =~ '^\(http\|https\):\/\/gist\.github\.com\/'
setlocal nomodified
+ redraw
echo 'Done: '.location
else
let message = matchstr(headers, '^Status: ')
@@ -481,6 +492,7 @@ function! s:GistDelete(user, token, gistid)
if len(token) > 0
let res = s:GistGetPage('https://gist.github.com/delete/'.a:gistid, a:user, '_method=delete&authenticity_token='.token, '')
if len(res.content) > 0
+ redraw
echo 'Done: '
else
let message = matchstr(res.header, '^Status: ')
@@ -576,6 +588,7 @@ function! s:GistPost(user, token, content, private)
let location = matchstr(headers, '^Location: ')
let location = substitute(location, '^[^:]\+: ', '', '')
if len(location) > 0 && location =~ '^\(http\|https\):\/\/gist\.github\.com\/'
+ redraw
echo 'Done: '.location
else
let message = matchstr(headers, '^Status: ')
@@ -638,6 +651,7 @@ function! s:GistPostBuffers(user, token, private)
let res = matchstr(split(res, '\(\r\?\n\|\r\n\?\)'), '^Location: ')
let res = substitute(res, '^.*: ', '', '')
if len(res) > 0 && res =~ '^\(http\|https\):\/\/gist\.github\.com\/'
+ redraw
echo 'Done: '.res
else
echoerr 'Post failed'
@@ -779,9 +793,12 @@ function! Gist(line1, line2, ...)
call system(cmd)
endif
endif
- if g:gist_put_url_to_clipboard_after_post == 1
+ if g:gist_put_url_to_clipboard_after_post > 0
+ if g:gist_put_url_to_clipboard_after_post == 2
+ let url = url . "\n"
+ endif
if exists('g:gist_clip_command')
- call system('echo '.url.' | '.g:gist_clip_command)
+ call system(g:gist_clip_command, url)
elseif has('unix') && !has('xterm_clipboard')
let @" = url
else

0 comments on commit 92254de

Please sign in to comment.