]> git.neil.brown.name Git - edlib.git/commitdiff
Remove pane_point.
authorNeilBrown <neil@brown.name>
Thu, 26 Nov 2015 01:06:40 +0000 (12:06 +1100)
committerNeilBrown <neil@brown.name>
Thu, 26 Nov 2015 01:06:40 +0000 (12:06 +1100)
Only one called remains, so open-code it there.

That caller should eventually go too.

Signed-off-by: NeilBrown <neil@brown.name>
core-keymap.c
core.h

index 1a7b5aca72d3f69f0d2854b27cf552a6840fdca8..d31f8ad9009f3be8e6f9238c3e9a61ed97e13a8f 100644 (file)
@@ -304,8 +304,13 @@ int key_handle(struct cmd_info *ci)
 
        ci->hx = ci->x;
        ci->hy = ci->y;
-       if (!ci->pointp)
-               ci->pointp = pane_point(p);
+       if (!ci->pointp) {
+               struct pane *p2 = p;
+               while (p2 && !p2->point)
+                       p2 = p2->parent;
+               if (p2)
+                       ci->pointp = &p2->point;
+       }
        while (ret == 0 && p) {
                if (p->handle) {
                        ci->home = p;
diff --git a/core.h b/core.h
index 4ca0ff9eb815d90dd523117783bbf672fe7066bc..1534e095d3e0e35afd78f1711e9257b4225d3bf6 100644 (file)
--- a/core.h
+++ b/core.h
@@ -309,14 +309,6 @@ struct pane *pane_attach(struct pane *p, char *type, struct pane *dp, char *arg)
 void pane_clear(struct pane *p, char *attrs);
 void pane_text(struct pane *p, wchar_t ch, char *attrs, int x, int y);
 char *pane_attr_get(struct pane *p, char *key);
-static inline struct point **pane_point(struct pane *p)
-{
-       while (p && !p->point)
-               p = p->parent;
-       if (p)
-               return &p->point;
-       return NULL;
-}
 
 static inline struct pane *pane_child(struct pane *p)
 {