From 8468ee337d0ee94e615c4e8caa07dafa57489a4e Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Wed, 18 Nov 2015 13:54:09 +1100 Subject: [PATCH] Simplify view-eol We only use 'pt' to get 'doc', so just take 'doc' directly. Signed-off-by: NeilBrown --- lib-view.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib-view.c b/lib-view.c index c355693f..0954a8de 100644 --- a/lib-view.c +++ b/lib-view.c @@ -360,27 +360,27 @@ DEF_CMD(view_WORD) DEF_CMD(view_eol) { - struct point *pt = *ci->pointp; + struct doc *d = (*ci->pointp)->doc; wint_t ch = 1; int rpt = RPT_NUM(ci); while (rpt > 0 && ch != WEOF) { - while ((ch = mark_next(pt->doc, ci->mark)) != WEOF && + while ((ch = mark_next(d, ci->mark)) != WEOF && ch != '\n') ; rpt -= 1; } while (rpt < 0 && ch != WEOF) { - while ((ch = mark_prev(pt->doc, ci->mark)) != WEOF && + while ((ch = mark_prev(d, ci->mark)) != WEOF && ch != '\n') ; rpt += 1; } if (ch == '\n') { if (RPT_NUM(ci) > 0) - mark_prev(pt->doc, ci->mark); + mark_prev(d, ci->mark); else if (RPT_NUM(ci) < 0) - mark_next(pt->doc, ci->mark); + mark_next(d, ci->mark); } return 1; } -- 2.39.5