I forgot to allow for the possibility that vedscreenlength might
not be an odd number. In that case, the lower vedwindowlength should
be increased by 1. Here's my current solution. Search for "mod" to find
the changed line. (I am not sure that the calls of vedcheck are
necessary.)
define vedsetwindow();
if vedwindowlength < vedscreenlength then
;;; expand to full window
vedscreenlength -> vedwindowlength;
0 -> vedscreenoffset;
vedcurrentfile -> vedupperfile;
false -> vedlowerfile;
vedcheck();
vedrefresh();
else
;;; Reduce to half window in bottom half of screen, adding 1
;;; if vedscreenlength is odd.
vedscreenlength div 2 + vedscreenlength mod 2 -> vedwindowlength;
vedscreenlength - vedwindowlength -> vedscreenoffset;
false -> vedupperfile;
vedcurrentfile -> vedlowerfile;
vedcheck();
vedrefresh();
endif
enddefine;
;;; Make ESC w use this version
vedsetkey('\^[w', "vedsetwindow");
Aaron
|