Introduction
Introduction Statistics Contact Development Disclaimer Help
tvi: page forward and backword on the last and first pages - neatvi - [fork] si…
git clone git://src.adamsgaard.dk/neatvi
Log
Files
Refs
README
---
commit 4b1b940dae17628b3ae84a84ae69d76df471662b
parent 9eea97a38d9862f405e00ab6a5b830a19a0df101
Author: Ali Gholami Rudi <[email protected]>
Date: Mon, 11 May 2015 18:45:44 +0430
vi: page forward and backword on the last and first pages
Diffstat:
M vi.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/vi.c b/vi.c
t@@ -641,17 +641,18 @@ static void vi(void)
redraw = 1;
break;
case TERMCTRL('b'):
+ if (xtop == 0)
+ break;
xtop = MAX(0, xtop - xrows + 1);
- xrow = xtop + xrows - 1;
+ xrow = MIN(xrow, xtop + xrows - 1);
lbuf_postindents(xb, &xrow, &xcol);
redraw = 1;
break;
case TERMCTRL('f'):
- if (lbuf_len(xb))
- xtop = MIN(lbuf_len(xb) - 1, xtop + xr…
- else
- xtop = 0;
- xrow = xtop;
+ if (xtop >= lbuf_len(xb) - 1)
+ break;
+ xtop = MIN(lbuf_len(xb) - 1, xtop + xrows - 1);
+ xrow = MAX(xrow, xtop);
lbuf_postindents(xb, &xrow, &xcol);
redraw = 1;
break;
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.