Skip to content

Commit 640a871

Browse files
committed
if g:gist_put_url_to_clipboard_after_post = 2, add linefeed to copying URL.
1 parent 28f47bb commit 640a871

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-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: 14 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: 14-Apr-2011.
4+
" Last Change: 15-Apr-2011.
55
" Version: 4.9
66
" WebPage: http://github.com/mattn/gist-vim
77
" License: BSD
@@ -92,6 +92,14 @@
9292
"
9393
" let g:gist_show_privates = 1
9494
"
95+
" * if you want to copy URL of the post...
96+
"
97+
" let g:gist_put_url_to_clipboard_after_post = 1
98+
"
99+
" or if you want to add linefeed more,
100+
"
101+
" let g:gist_put_url_to_clipboard_after_post = 2
102+
"
95103
" Thanks:
96104
" MATSUU Takuto:
97105
" removed carriage return
@@ -777,9 +785,12 @@ function! Gist(line1, line2, ...)
777785
call system(cmd)
778786
endif
779787
endif
780-
if g:gist_put_url_to_clipboard_after_post == 1
788+
if g:gist_put_url_to_clipboard_after_post > 0
789+
if g:gist_put_url_to_clipboard_after_post == 2
790+
let url = url . "\n"
791+
endif
781792
if exists('g:gist_clip_command')
782-
call system('echo '.url.' | '.g:gist_clip_command)
793+
call system(g:gist_clip_command, url)
783794
elseif has('unix') && !has('xterm_clipboard')
784795
let @" = url
785796
else

0 commit comments

Comments
 (0)