]> git.neil.brown.name Git - edlib.git/commitdiff
Discard pane_set_extra()
authorNeilBrown <neil@brown.name>
Sat, 23 Sep 2017 03:48:12 +0000 (05:48 +0200)
committerNeilBrown <neil@brown.name>
Wed, 27 Sep 2017 08:35:10 +0000 (18:35 +1000)
having a trivial helper for this is pointless.
Also set extra from 'numeric', not 'extra', so the open-coded call
is even easier.

Signed-off-by: NeilBrown <neil@brown.name>
core-keymap.c
core-pane.c
core.h
lib-input.c
mode-emacs.c

index 736a6ab672afc61bc364d99f05c0920ff9cad960..dc47cbded1b701c878280f41230c57c9b3d7d5f9 100644 (file)
@@ -239,7 +239,7 @@ static int key_prefix(const struct cmd_info *ci safe)
 
        pane_set_mode(ci->focus, m->name);
        pane_set_numeric(ci->focus, ci->numeric);
-       pane_set_extra(ci->focus, ci->extra);
+       call("Mode:set-extra", ci->focus, ci->extra);
        return 1;
 }
 
index 967ae63f5b530102ba9f4826f5baddea034a0488..1aa9a22a832a52a1f0836fdd2e90f74bec49d808 100644 (file)
@@ -581,11 +581,6 @@ void pane_set_numeric(struct pane *p safe, int numeric)
        call("Mode:set-numeric", p, numeric);
 }
 
-void pane_set_extra(struct pane *p safe, int extra)
-{
-       call("Mode:set-extra", p, 0, NULL, NULL, extra);
-}
-
 void pane_clear(struct pane *p safe, char *attrs)
 {
        call("pane-clear", p, 0, NULL, NULL, 0, NULL, attrs);
diff --git a/core.h b/core.h
index f46da85b96f254322483b9f0015d768f0de8296b..8ef156083f2a5ebd2ef3c5070f85018f40668d22 100644 (file)
--- a/core.h
+++ b/core.h
@@ -350,7 +350,6 @@ struct pane *pane_my_child(struct pane *p, struct pane *c);
 int pane_masked(struct pane *p safe, int x, int y, int abs_z, int *w, int *h);
 void pane_set_mode(struct pane *p safe, char *mode);
 void pane_set_numeric(struct pane *p safe, int numeric);
-void pane_set_extra(struct pane *p safe, int extra);
 void pane_clear(struct pane *p safe, char *attrs);
 char *pane_attr_get(struct pane *p, char *key safe);
 char *pane_mark_attr(struct pane *p safe, struct mark *m safe, bool forward, char *key safe);
index 921ada0e773e0ef95536716b3c7ba06ca00a60a4..63bcb6e83943b1b20f2e5081598808c11e9aef03 100644 (file)
@@ -41,7 +41,7 @@ DEF_CMD(set_extra)
 {
        struct input_mode *im = ci->home->data;
 
-       im->extra = ci->extra;
+       im->extra = ci->numeric;
        return 1;
 }
 
index c7a10bd3d957a03f2bc7eb6712bd73ceb9e52b84..a7f60bef45999627b255f8cf17c2998773694adb 100644 (file)
@@ -130,7 +130,7 @@ REDEF_CMD(emacs_delete)
        }
        ret = call("Replace", ci->focus, 1, m, NULL, !ci->extra);
        mark_free(m);
-       pane_set_extra(ci->focus, 1);
+       call("Mode:set-extra", ci->focus, 1);
 
        return ret;
 }
@@ -207,7 +207,7 @@ REDEF_CMD(emacs_case)
                                        call(mv->type+1, ci->focus, dir, ci->mark);
                        }
                        free(str);
-                       pane_set_extra(ci->focus, 1);
+                       call("Mode:set-extra", ci->focus, 1);
                }
                mark_free(m);
                cnt -= 1;
@@ -314,7 +314,7 @@ DEF_CMD(emacs_recenter)
                call("Move-View-Line", ci->focus, 0, ci->mark);
                call("Display:refresh", ci->focus);
        }
-       call("Mode:set-extra", ci->focus, 0, NULL, NULL, 2| step);
+       call("Mode:set-extra", ci->focus, | step);
        return 1;
 }
 
@@ -389,7 +389,7 @@ DEF_CMD(emacs_insert)
        /* Key is "Chr-X" - skip 4 bytes to get X */
        str = ci->key + 4;
        ret = call("Replace", ci->focus, 1, ci->mark, str, !ci->extra);
-       pane_set_extra(ci->focus, 1);
+       call("Mode:set-extra", ci->focus, 1);
 
        return ret;
 }
@@ -435,7 +435,7 @@ DEF_CMD(emacs_insert_other)
                mark_to_mark(ci->mark, m);
                mark_free(m);
        }
-       pane_set_extra(ci->focus, 0); /* A newline starts a new undo */
+       call("Mode:set-extra", ci->focus, 0); /* A newline starts a new undo */
        return ret;
 }
 
@@ -797,7 +797,7 @@ DEF_CMD(emacs_meta)
 {
        pane_set_mode(ci->focus, "M-");
        pane_set_numeric(ci->focus, ci->numeric);
-       pane_set_extra(ci->focus, ci->extra);
+       call("Mode:set-extra", ci->focus, ci->extra);
        return 1;
 }
 
@@ -817,14 +817,14 @@ DEF_CMD(emacs_num)
        rpt = rpt * 10 + *last - '0';
 
        pane_set_numeric(ci->focus, neg ? -rpt : rpt);
-       pane_set_extra(ci->focus, ci->extra);
+       call("Mode:set-extra", ci->focus, ci->extra);
        return 1;
 }
 
 DEF_CMD(emacs_neg)
 {
        pane_set_numeric(ci->focus, - ci->numeric);
-       pane_set_extra(ci->focus, ci->extra);
+       call("Mode:set-extra", ci->focus, ci->extra);
        return 1;
 }