| Date: Sun, 28 Jun 2015 23:47:49 +0430
vi: do not reset xrow in vi()
Reported by Christian Neukirchen .
Diffstat:
M ex.c | 2 +-
M vi.c | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
--- |
| t@@ -339,7 +339,7 @@ static int ec_edit(char *ec)
ex_path(), lbuf_len(xb));
ex_show(msg);
}
- xrow = MAX(0, MIN(xrow, lbuf_len(xb) - 1));
+ xrow = xvis ? 0 : MAX(0, MIN(xrow, lbuf_len(xb) - 1));
lbuf_saved(xb, path[0] != '\0');
return 0;
} |
| t@@ -1000,8 +1000,7 @@ static void vi(void)
int mark;
char *ln;
char *kmap = NULL;
- xtop = 0;
- xrow = 0;
+ xtop = xrow;
xoff = 0;
xcol = vi_off2col(xb, xrow, xoff);
vi_draw(xcol); |