]> git.neil.brown.name Git - edlib.git/commitdiff
Remove pointp usage from a lot of Move-* calls.
authorNeilBrown <neil@brown.name>
Thu, 26 Nov 2015 06:14:08 +0000 (17:14 +1100)
committerNeilBrown <neil@brown.name>
Thu, 26 Nov 2015 06:16:25 +0000 (17:16 +1100)
Signed-off-by: NeilBrown <neil@brown.name>
lib-view.c
mode-emacs.c
render-lines.c

index 02e20fe1b34993bd56bb53b273a7bc0cada9c770..1736e92ea736adddec05750260aec175d297e257 100644 (file)
@@ -263,8 +263,7 @@ DEF_CMD(view_click)
        ci2.focus = p;
        ci2.key = "Move-View-Small";
        ci2.numeric = RPT_NUM(ci);
-       ci2.mark = &(*ci->pointp)->m;
-       ci2.pointp = ci->pointp;
+       ci2.mark = ci->mark;
 
        if (ci->hy == mid-1) {
                /* scroll up */
index 2b753e3b9e2c8aa7e2d99d8eafb70f2631a9493e..0177bae75727747d4153105036ccbb3b463d0cc7 100644 (file)
@@ -70,7 +70,6 @@ REDEF_CMD(emacs_move)
 {
        struct move_command *mv = container_of(ci->comm, struct move_command, cmd);
        struct pane *cursor_pane = pane_with_cursor(ci->home, NULL, NULL);
-       struct point *pt = *ci->pointp;
        int old_x = -1;
        struct cmd_info ci2 = {0};
        int ret = 0;
@@ -82,8 +81,7 @@ REDEF_CMD(emacs_move)
        ci2.focus = ci->focus;
        ci2.key = mv->type;
        ci2.numeric = mv->direction * RPT_NUM(ci);
-       ci2.mark = &pt->m;
-       ci2.pointp = ci->pointp;
+       ci2.mark = ci->mark;
        ret = key_handle_focus(&ci2);
 
        if (!ret)
@@ -101,7 +99,6 @@ REDEF_CMD(emacs_move)
                        ci2.y = 0;
                else
                        ci2.y = cursor_pane->h - 1;
-               ci2.pointp = ci->pointp;
                key_handle_xy(&ci2);
        }
 
index 80febb212f6a6c71d7fcc30d8319135e0cef4283..da69aa0e88261ad2a4b19f752780727a113ba552 100644 (file)
@@ -724,7 +724,6 @@ DEF_CMD(render_lines_move)
 DEF_CMD(render_lines_set_cursor)
 {
        struct pane *p = ci->home;
-       struct point **ptp = ci->pointp;
        struct rl_data *rl = p->data;
        struct rl_mark *m;
        int y = rl->header_lines - rl->skip_lines;
@@ -740,7 +739,7 @@ DEF_CMD(render_lines_set_cursor)
                if (o >= 0) {
                        struct mark *m2 = call_render_line_offset(p, m, o);
                        if (m2) {
-                               point_to_mark(*ptp, m2);
+                               mark_to_mark(ci->mark, m2);
                                mark_free(m2);
                                found = 1;
                        }
@@ -785,7 +784,6 @@ DEF_CMD(render_lines_move_line)
         */
        struct pane *p = ci->home;
        struct rl_data *rl = p->data;
-       struct point **ptp = ci->pointp;
        struct cmd_info ci2 = {0};
        int target_x, target_y;
        int o = -1;
@@ -806,8 +804,7 @@ DEF_CMD(render_lines_move_line)
                ci2.numeric -= 1;
        else
                ci2.numeric += 1;
-       ci2.mark = &(*ptp)->m;
-       ci2.pointp = ci->pointp;
+       ci2.mark = ci->mark;
        if (!key_handle_focus(&ci2))
                return -1;
        if (RPT_NUM(ci) > 0) {