From: NeilBrown Date: Tue, 12 Jan 2016 03:00:03 +0000 (+1100) Subject: Remove pane_with_cursor. X-Git-Tag: lca2016~24 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=61f4da233de23f810942c94962004e6a2a7add67;p=edlib.git Remove pane_with_cursor. No longer needed. Signed-off-by: NeilBrown --- diff --git a/core-pane.c b/core-pane.c index 10d1bf36..73b83784 100644 --- a/core-pane.c +++ b/core-pane.c @@ -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 f256397f..0bcb15e4 100644 --- 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); diff --git a/mode-emacs.c b/mode-emacs.c index 1c1bd341..cf8d1ca0 100644 --- a/mode-emacs.c +++ b/mode-emacs.c @@ -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 a68fe3c9..09ba7e3c 100644 --- 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); -