Skip to content
Browse files

Make it possible to disable use of the DDL (useful during testing)

  • Loading branch information...
1 parent 1e50986 commit c6972970c79e7488be0c950281d9bf732df98b53 @xolox committed
Showing with 16 additions and 1 deletion.
  1. +4 −0 README.md
  2. +5 −1 autoload/xolox/shell.vim
  3. +7 −0 doc/shell.txt
View
4 README.md
@@ -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.
View
6 autoload/xolox/shell.vim
@@ -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"
@@ -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
View
7 doc/shell.txt
@@ -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|
@@ -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 ~

0 comments on commit c697297

Please sign in to comment.
Something went wrong with that request. Please try again.