Skip to content

Commit

Permalink
Make it possible to disable use of the DDL (useful during testing)
Browse files Browse the repository at this point in the history
  • Loading branch information
xolox committed Jun 30, 2014
1 parent 1e50986 commit c697297
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -120,6 +120,10 @@ When you use the `:Open` command or the `<F6>` mapping to open the URL under the

If you actually deal with URLs that include significant trailing punctuation and your Vim is compiled with Python support you can enable the option `g:shell_verify_urls` (by setting it to 1 in your [vimrc script] [vimrc]). When you do this the plug-in will perform an HTTP HEAD request on the URL without stripping trailing punctuation. If the request returns an HTTP status code that indicates some form of success (the status code is at least 200 and less than 400) the URL including trailing punctuation is opened. If the HEAD request fails the plug-in will try again without trailing punctuation.

### The `g:shell_use_dll` option

If you set this to false (0) the DDL is never used. This is very useful during testing :-).

## Background

Vim has a limited ability to call external libraries using the Vim script function [libcall()] [libcall]. A few years ago when I was still using Windows a lot I created a [Windows DLL] [dll] that could be used with [libcall()] [libcall] to toggle [Vim] [vim]'s GUI window between regular and full-screen mode. I also added a few other useful functions, e.g. `openurl()` to launch the default web browser and `execute()` which works like Vim's [system()] [system] function but doesn't wait for the process to finish and doesn't show a command prompt.
Expand Down
6 changes: 5 additions & 1 deletion autoload/xolox/shell.vim
Expand Up @@ -3,7 +3,7 @@
" Last Change: June 30, 2014
" URL: http://peterodding.com/code/vim/shell/

let g:xolox#shell#version = '0.13.4'
let g:xolox#shell#version = '0.13.5'

if !exists('s:fullscreen_enabled')
let s:enoimpl = "%s() hasn't been implemented on your platform! %s"
Expand Down Expand Up @@ -373,6 +373,10 @@ function! xolox#shell#can_use_dll() " {{{1
if xolox#misc#os#is_win()
try
call xolox#misc#msg#debug("shell.vim %s: Checking if compiled DDL is supported ..", g:xolox#shell#version)
if !xolox#misc#option#get('shell_use_dll', 1)
call xolox#misc#msg#debug("shell.vim %s: Use of DDL is disabled using 'g:shell_use_dll'.", g:xolox#shell#version)
return 0
endif
let expected_version = '0.5'
let actual_version = s:library_call('libversion', '')
if actual_version == expected_version
Expand Down
7 changes: 7 additions & 0 deletions doc/shell.txt
Expand Up @@ -17,6 +17,7 @@ Contents ~
9. The |g:shell_fullscreen_always_on_top| option
10. The |g:shell_mappings_enabled| option
11. The |g:shell_verify_urls| option
12. The |g:shell_use_dll| option
4. Background |shell-background|
5. Other full-screen implementations |shell-other-full-screen-implementations|
6. Contact |shell-contact|
Expand Down Expand Up @@ -256,6 +257,12 @@ some form of success (the status code is at least 200 and less than 400) the
URL including trailing punctuation is opened. If the HEAD request fails the
plug-in will try again without trailing punctuation.

-------------------------------------------------------------------------------
The *g:shell_use_dll* option

If you set this to false (0) the DDL is never used. This is very useful during
testing :-).

===============================================================================
*shell-background*
Background ~
Expand Down

0 comments on commit c697297

Please sign in to comment.