]> git.neil.brown.name Git - edlib.git/commitdiff
Remove pane_with_cursor.
authorNeilBrown <neil@brown.name>
Tue, 12 Jan 2016 03:00:03 +0000 (14:00 +1100)
committerNeilBrown <neil@brown.name>
Tue, 12 Jan 2016 03:00:03 +0000 (14:00 +1100)
No longer needed.

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

index 10d1bf36b98aa13b73ea4b540969641927cd0a0c..73b837848d0609f08f124f60043d55f2431aeac2 100644 (file)
@@ -449,30 +449,6 @@ struct editor *pane2ed(struct pane *p)
        return container_of(p, struct editor, root);
 }
 
-struct pane *pane_with_cursor(struct pane *p, int *oxp, int *oyp)
-{
-       struct pane *ret = p;
-       int ox = 0, oy = 0;
-       if (oxp) {
-               *oxp = 0;
-               *oyp = 0;
-       }
-       while (p) {
-               ox += p->x;
-               oy += p->y;
-
-               if (p->cx >= 0 && p->cy >= 0) {
-                       ret = p;
-                       if (oxp) {
-                               *oxp = ox;
-                               *oyp = oy;
-                       }
-               }
-               p = p->focus;
-       }
-       return ret;
-}
-
 DEF_CMD(pane_callback)
 {
        struct call_return *cr = container_of(ci->comm, struct call_return, c);
diff --git a/core.h b/core.h
index f256397fffed9f3aae87ee7bf291fed76a0e86e1..0bcb15e48df9d92132e235d3ae0a38fed43cc065 100644 (file)
--- a/core.h
+++ b/core.h
@@ -339,7 +339,6 @@ void pane_resize(struct pane *p, int x, int y, int w, int h);
 void pane_check_size(struct pane *p);
 void pane_refresh(struct pane *p);
 void pane_focus(struct pane *p);
-struct pane *pane_with_cursor(struct pane *p, int *ox, int *oy);
 void pane_damaged(struct pane *p, int type);
 struct pane *pane_to_root(struct pane *p, int *x, int *y, int *z,
                          int *w, int *h);
index 1c1bd3415341c8459288aeace9d22393bd057a0d..cf8d1ca0a02785e3715c5ff91c079197b4f8924a 100644 (file)
@@ -69,7 +69,7 @@ static struct move_command {
 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 pane *cursor_pane = ci->focus;
        int old_x = -1;
        struct cmd_info ci2 = {0};
        int ret = 0;
diff --git a/rexel.h b/rexel.h
index a68fe3c910773a714db1beecd6bf393dff062b80..09ba7e3c024d2eeee85be824e356d256cdeb19f2 100644 (file)
--- a/rexel.h
+++ b/rexel.h
@@ -8,4 +8,3 @@ unsigned short *rxl_parse_verbatim(char *patn, int nocase);
 struct match_state *rxl_prepare(unsigned short *rxl);
 void rxl_free_state(struct match_state *s);
 int rxl_advance(struct match_state *st, wint_t ch, int flag, int restart);
-