Skip to content

Commit

Permalink
Throw an error if Accordion size is changed to <1
Browse files Browse the repository at this point in the history
fixes #27
  • Loading branch information
mattboehm committed Oct 21, 2013
1 parent 593b1dd commit ea098b3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Expand Up @@ -7,7 +7,7 @@ Accordion lets you set the maximum number of vsplits you want to see, and shrink

If you want to view changes to a file over time, it's got a fancy diff mode. Even if you're not big on vsplits, you may want to consider Accordion for this feature alone.

Version 0.3.2
Version 0.3.3

But I Don't Use Splits!
-----------------------
Expand Down
16 changes: 12 additions & 4 deletions autoload/accordion.vim
Expand Up @@ -100,12 +100,20 @@ endfunction
function! accordion#ChangeSize(change)
"change tab variable if it exists
if exists("t:accordion_size")
let t:accordion_size += a:change
call accordion#Accordion()
if t:accordion_size + a:change >= 1
let t:accordion_size += a:change
call accordion#Accordion()
else
echoerr "Accordion size can't be less than 1"
endif
"else change global if it exists
elseif exists("g:accordion_size")
let g:accordion_size += a:change
call accordion#Accordion()
if g:accordion_size + a:change >= 1
let g:accordion_size += a:change
call accordion#Accordion()
else
echoerr "Accordion size can't be less than 1"
endif
"no tab or global setting to change
else
echom "Accordion can't change size; none set."
Expand Down
1 change: 1 addition & 0 deletions doc/accordion.txt
Expand Up @@ -58,6 +58,7 @@ ZOOMING *accordion-zooming*
:AccordionZoomIn *:AccordionZoomIn*
Subtract 1 from maximum number of vsplits
Tries to modify tab setting. If there is none, modifies global setting
Raises an error if the new size would be less than 1

:AccordionZoomOut *:AccordionZoomOut*
Add 1 to maximum number of vsplits
Expand Down

0 comments on commit ea098b3

Please sign in to comment.