7848d65f0425

Add optional parameter for window height

If g:clam_winheight is set, the output buffer will resize itself
horizontally to the desired height.
[view raw] [browse files]
author Jethro Van Thuyne <post@jethro.be>
date Tue, 03 May 2016 15:27:16 +0200
parents bd953da76618
children b0eed33fef1e
branches/tags (none)
files doc/clam.txt plugin/clam.vim

Changes

--- a/doc/clam.txt	Fri Mar 25 21:40:12 2016 +0000
+++ b/doc/clam.txt	Tue May 03 15:27:16 2016 +0200
@@ -16,6 +16,8 @@
         2.2 Pipe ....................... |ClamPipe|
     3. Configuration ................... |ClamConfiguration|
         3.1 g:clam_autoreturn .......... |ClamConfiguration_autoreturn|
+        3.2 g:clam_winpos .............. |ClamConfiguration_winpos|
+        3.3 g:clam_winheight ........... |ClamConfiguration_winheight|
     4. License ......................... |ClamLicense|
     5. Bugs ............................ |ClamBugs|
     6. Contributing .................... |ClamContributing|
@@ -124,6 +126,15 @@
 
 Default: 'vertical botright' (split vertical, open at far right)
 
+------------------------------------------------------------------------------
+3.3 g:clam_winheight                             *ClamConfiguration_winheight*
+
+This option controls the height of the output window: >
+
+    let g:clam_winheight = 5
+
+Default: no value (horizontal split at 50%)
+
 ==============================================================================
 4. License                                                       *ClamLicense*
 
--- a/plugin/clam.vim	Fri Mar 25 21:40:12 2016 +0000
+++ b/plugin/clam.vim	Tue May 03 15:27:16 2016 +0200
@@ -34,6 +34,9 @@
     " Open the new window (or move to an existing one).
     if winnr < 0
         silent! execute g:clam_winpos . ' new ' . buffer_name
+        if exists('g:clam_winheight') "{{{
+          silent! execute 'resize ' . g:clam_winheight
+        endif "}}}
 
         " Highlight ANSI color codes if the AnsiEsc plugin is present.
         if exists("g:loaded_AnsiEscPlugin")
@@ -41,6 +44,9 @@
         endif
     else
         silent! execute winnr . 'wincmd w'
+        if exists('g:clam_winheight') "{{{
+          silent! execute 'resize ' . g:clam_winheight
+        endif "}}}
     endif
 endfunction " }}}
 function! s:ExtractBareCommanName(fullCommand) " {{{