Skip to content

Commit a0ed509

Browse files
committed
Define version as variable, include version in messages
1 parent d0f9718 commit a0ed509

File tree

4 files changed

+24
-17
lines changed

4 files changed

+24
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ If you have questions, bug reports, suggestions, etc. the author can be contacte
9292
## License
9393

9494
This software is licensed under the [MIT license](http://en.wikipedia.org/wiki/MIT_License).
95-
© 2010 Peter Odding &lt;<peter@peterodding.com>&gt;.
95+
© 2011 Peter Odding &lt;<peter@peterodding.com>&gt;.
9696

9797

9898
[ctags]: http://en.wikipedia.org/wiki/Ctags

autoload/xolox/shell.vim

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
" Vim auto-load script
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: June 17, 2011
3+
" Last Change: June 18, 2011
44
" URL: http://peterodding.com/code/vim/shell/
55

6-
if !exists('s:script')
7-
let s:script = 'shell.vim'
6+
if !exists('s:fullscreen_enabled')
87
let s:enoimpl = "%s() hasn't been implemented on your platform! %s"
9-
let s:contact = "If you have suggestions, please contact the vim_dev mailing-list or peter@peterodding.com."
8+
let s:contact = "If you have suggestions, please contact peter@peterodding.com."
109
let s:fullscreen_enabled = 0
1110
endif
1211

@@ -23,12 +22,12 @@ function! xolox#shell#open_cmd(arg) " -- implementation of the :Open command {{{
2322
if isdirectory(arg) || filereadable(arg)
2423
call xolox#misc#open#file(arg)
2524
else
26-
let msg = "%s: I don't know how to open %s!"
27-
echoerr printf(msg, s:script, string(a:arg))
25+
let msg = "I don't know how to open '%s'! %s"
26+
echoerr printf(msg, a:arg, s:contact)
2827
endif
2928
endif
3029
catch
31-
call xolox#misc#msg#warn("%s at %s", v:exception, v:throwpoint)
30+
call xolox#misc#msg#warn("shell.vim %s: %s at %s", g:shell_version, v:exception, v:throwpoint)
3231
endtry
3332
endfunction
3433

@@ -66,8 +65,8 @@ function! xolox#shell#open_with_windows_shell(location)
6665
if xolox#misc#os#is_win() && s:has_dll()
6766
let error = s:library_call('openurl', a:location)
6867
if error != ''
69-
let msg = '%s: Failed to open %s with Windows shell! (error: %s)'
70-
throw printf(msg, s:script, string(a:location), strtrans(xolox#misc#str#trim(error)))
68+
let msg = "shell.vim %s: Failed to open '%s' with Windows shell! (error: %s)"
69+
throw printf(msg, g:shell_version, a:location, strtrans(xolox#misc#str#trim(error)))
7170
endif
7271
endif
7372
endfunction
@@ -128,7 +127,7 @@ function! xolox#shell#execute(command, synchronous, ...) " -- execute external c
128127
return 1
129128
endif
130129
catch
131-
call xolox#misc#msg#warn("%s: %s at %s", s:script, v:exception, v:throwpoint)
130+
call xolox#misc#msg#warn("shell.vim %s: %s at %s", g:shell_version, v:exception, v:throwpoint)
132131
finally
133132
if exists('tempin') | call delete(tempin) | endif
134133
if exists('tempout') | call delete(tempout) | endif
@@ -179,7 +178,7 @@ function! xolox#shell#fullscreen() " -- toggle Vim between normal and full-scree
179178
throw printf(s:enoimpl, 'fullscreen', s:contact)
180179
endif
181180
catch
182-
call xolox#misc#msg#warn("%s: %s at %s", s:script, v:exception, v:throwpoint)
181+
call xolox#misc#msg#warn("shell.vim %s: %s at %s", g:shell_version, v:exception, v:throwpoint)
183182
endtry
184183

185184
" When leaving full-screen...
@@ -208,7 +207,7 @@ function! xolox#shell#fullscreen() " -- toggle Vim between normal and full-scree
208207
" Take a moment to let Vim's GUI finish redrawing (:redraw is
209208
" useless here because it only redraws Vim's internal state).
210209
sleep 50 m
211-
call xolox#misc#msg#info("To return from full-screen type <F11> or execute :Fullscreen.")
210+
call xolox#misc#msg#info("shell.vim %s: To return from full-screen type <F11> or execute :Fullscreen.", g:shell_version)
212211
endif
213212

214213
endfunction

doc/shell.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ If you like the plug-in please vote for it on Vim Online [8].
195195
*shell-license*
196196
License ~
197197

198-
This software is licensed under the MIT license [13]. Copyright 2010 Peter
198+
This software is licensed under the MIT license [13]. Copyright 2011 Peter
199199
Odding <peter@peterodding.com>.
200200

201201
===============================================================================

plugin/shell.vim

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
" Vim plug-in
22
" Author: Peter Odding <peter@peterodding.com>
3-
" Last Change: June 17, 2011
3+
" Last Change: June 18, 2011
44
" URL: http://peterodding.com/code/vim/shell/
5-
" License: MIT
6-
" Version: 0.9.6
75

86
" Support for automatic update using the GLVS plug-in.
97
" GetLatestVimScripts: 3123 1 :AutoInstall: shell.zip
108

9+
" Don't source the plug-in when it's already been loaded or &compatible is set.
10+
if &cp || exists('g:loaded_shell')
11+
finish
12+
endif
13+
14+
let g:shell_version = '0.9.7'
15+
1116
" Configuration defaults. {{{1
1217

1318
if !exists('g:shell_mappings_enabled')
@@ -54,4 +59,7 @@ if g:shell_mappings_enabled
5459
nnoremap <F6> :Open<CR>
5560
endif
5661

62+
" Make sure the plug-in is only loaded once.
63+
let g:loaded_shell = 1
64+
5765
" vim: ts=2 sw=2 et fdm=marker

0 commit comments

Comments
 (0)