]> git.neil.brown.name Git - edlib.git/commitdiff
use doc_get_pane to get document for render-format movement.
authorNeilBrown <neil@brown.name>
Thu, 26 Nov 2015 02:12:30 +0000 (13:12 +1100)
committerNeilBrown <neil@brown.name>
Thu, 26 Nov 2015 02:12:30 +0000 (13:12 +1100)
Removes another pointp user

Signed-off-by: NeilBrown <neil@brown.name>
render-format.c

index 043c5e07d9a8b50a598ae33a0dadc2cf6041dfa0..ea708495573d93ed0b13c62a3f8111a5875d3023 100644 (file)
@@ -186,17 +186,18 @@ DEF_CMD(format_clone)
 
 DEF_CMD(format_move_line)
 {
-       struct point *pt = *ci->pointp;
+       struct pane *dp = doc_get_pane(ci->focus);
+       struct doc *d = dp->data;
        int rpt = RPT_NUM(ci);
        struct rf_data *rf = ci->home->data;
 
        while (rpt > 1) {
-               if (mark_next(pt->doc, ci->mark) == WEOF)
+               if (mark_next(d, ci->mark) == WEOF)
                        break;
                rpt -= 1;
        }
        while (rpt < -1) {
-               if (mark_prev(pt->doc, ci->mark) == WEOF)
+               if (mark_prev(d, ci->mark) == WEOF)
                        break;
                rpt += 1;
        }
@@ -214,17 +215,18 @@ DEF_CMD(format_move_horiz)
        /* Horizonal movement - adjust ->rpos within fields, or
         * move to next line
         */
-       struct point *pt = *ci->pointp;
+       struct pane *dp = doc_get_pane(ci->focus);
+       struct doc *d = dp->data;
        struct rf_data *rf = ci->home->data;
        int rpt = RPT_NUM(ci);
 
        if (rf->fields < 2)
                return 1;
-       while (rpt > 0 && doc_following(pt->doc, ci->mark) != WEOF) {
+       while (rpt > 0 && doc_following(d, ci->mark) != WEOF) {
                if (ci->mark->rpos < rf->fields - rf->home_field + 1)
                        ci->mark->rpos += 1;
                else {
-                       if (mark_next(pt->doc, ci->mark) == WEOF)
+                       if (mark_next(d, ci->mark) == WEOF)
                                break;
                        ci->mark->rpos = -rf->home_field;
                }
@@ -234,7 +236,7 @@ DEF_CMD(format_move_horiz)
                if (ci->mark->rpos > -rf->home_field)
                        ci->mark->rpos -= 1;
                else {
-                       if (mark_prev(pt->doc, ci->mark) == WEOF)
+                       if (mark_prev(d, ci->mark) == WEOF)
                                break;
                        ci->mark->rpos = rf->fields - rf->home_field + 1;
                }