DEF_CMD_CLOSED(tile_close)
{
- struct tileinfo *ti = ci->home->data;
+ struct tileinfo *ti = ci->home->_data;
tile_destroy(ci->home);
free(ti->name);
DEF_CMD(tile_refresh_size)
{
struct pane *p = ci->home;
- struct tileinfo *ti = p->data;
+ struct tileinfo *ti = p->_data;
if (ti->direction == Neither) {
tile_avail(p, NULL);
* create a single tile, cloned from the focus pane
*/
child = ci->home;
- cti = child->data;
+ cti = child->_data;
alloc(ti, pane);
ti->leaf = 1;
ti->direction = Neither;
attr_set_str(&p2->attrs, "borders", "BL");
while (!cti->leaf && child->focus) {
child = child->focus;
- cti = child->data;
+ cti = child->_data;
}
cti = list_next_entry(cti, tiles);
- while (cti != child->data &&
+ while (cti != child->_data &&
(cti->name == NULL || strcmp(cti->name, "main") != 0))
cti = list_next_entry(cti, tiles);
child = cti->p;
int space, new_space;
struct pane *p = safe_cast *pp;
struct pane *ret;
- struct tileinfo *ti = p->data;
+ struct tileinfo *ti = p->_data;
struct tileinfo *ti2;
if (horiz)
space = p->w;
ti2->direction = ti->direction;
ti2->group = ti->group;
INIT_LIST_HEAD(&ti2->tiles);
- p->data = ti2;
+ p->_data = ti2;
ti2->p = p;
p2 = pane_register(p, 0, &tile_handle.c, ti);
if (!p2)
static int tile_destroy(struct pane *p safe)
{
- struct tileinfo *ti = p->data;
+ struct tileinfo *ti = p->_data;
struct pane *prev = NULL, *next = NULL;
struct pane *t, *remain = NULL;
int pos, prevpos, nextpos;
* Cannot destroy the parent, so bring child into parent */
p = remain->parent;
- ti = remain->data;
- ti2 = p->data;
+ ti = remain->_data;
+ ti2 = p->_data;
tmp = ti2->direction;
ti2->direction = ti->direction;
* if stacking direction doesn't match 'horiz', find minimum.
* If only one child, assume min of 4.
*/
- struct tileinfo *ti = p->data;
+ struct tileinfo *ti = p->_data;
struct pane *t;
if (ti->leaf) {
if (t == ignore || !mine(t))
continue;
tile_avail(t, NULL);
- ti2 = t->data;
+ ti2 = t->_data;
if (min < 0 || min > ti2->avail_perp)
min = ti2->avail_perp;
sum += ti2->avail_inline;
int avail_cnt = 0;
int pos;
int size = 0;
- struct tileinfo *ti = p->data;
+ struct tileinfo *ti = p->_data;
if (ti->leaf)
/* Children are responsible for themselves. */
if (!mine(t))
continue;
- ti = t->data;
+ ti = t->_data;
if (ti->direction == Horiz) {
pane_resize(t, t->x, 0, t->w, p->h);
used += t->w;
cnt = avail_cnt;
avail_cnt = 0;
list_for_each_entry(t, &p->children, siblings) {
- struct tileinfo *ti2 = t->data;
+ struct tileinfo *ti2 = t->_data;
int diff;
int mysize;
if (!mine(t))
}
pos = 0;
list_for_each_entry(t, &p->children, siblings) {
- struct tileinfo *ti2 = t->data;
+ struct tileinfo *ti2 = t->_data;
if (!mine(t))
continue;
if (ti2->direction == Horiz) {
* Then that propagates back down. Size of this pane is adjusted
* first to catch the propagations, then corrected after.
*/
- struct tileinfo *ti = p->data;
+ struct tileinfo *ti = p->_data;
struct tileinfo *tip;
int avail;
/* Hoping to grow if there is room for others to shrink */
tile_avail(p->parent, p);
- tip = p->parent->data;
+ tip = p->parent->_data;
if (ti->direction == (horiz ? Horiz : Vert))
avail = tip->avail_inline;
else
struct pane *p = next_child(ti->p, NULL, 0);
if (!p)
return NULL;
- ti = p->data;
+ ti = p->_data;
}
return ti;
}
while (ti->direction != Neither) {
if (ti->p != next_child(ti->p->parent, NULL, 0))
return False;
- ti = ti->p->parent->data;
+ ti = ti->p->parent->_data;
}
return True;
}
static struct pane *tile_root_popup(struct tileinfo *ti safe)
{
while (ti->direction != Neither)
- ti = ti->p->parent->data;
+ ti = ti->p->parent->_data;
return next_child(ti->p, NULL, 1);
}
static bool wrong_pane(struct cmd_info const *ci safe)
{
- struct tileinfo *ti = ci->home->data;
+ struct tileinfo *ti = ci->home->_data;
if (ci->str || ti->group) {
if (!ci->str || !ti->group)
*/
struct pane *p = ci->home;
struct pane *p2;
- struct tileinfo *ti = p->data;
+ struct tileinfo *ti = p->_data;
struct tileinfo *t2;
if (wrong_pane(ci))
DEF_CMD(tile_window_prev)
{
struct pane *p = ci->home;
- struct tileinfo *ti = p->data;
+ struct tileinfo *ti = p->_data;
struct tileinfo *t2;
if (wrong_pane(ci))
DEF_CMD(tile_window_close)
{
struct pane *p = ci->home;
- struct tileinfo *ti = p->data;
+ struct tileinfo *ti = p->_data;
if (wrong_pane(ci))
return Efallthrough;
{
struct pane *p = ci->home;
struct pane *parent = p->parent;
- struct tileinfo *ti = p->data;
+ struct tileinfo *ti = p->_data;
bool found = True;
if (wrong_pane(ci))
*/
struct pane *p = ci->home;
struct pane *p2;
- struct tileinfo *ti = p->data;
+ struct tileinfo *ti = p->_data;
struct tileinfo *ti2;
int horiz, after;
DEF_CMD(tile_this)
{
- struct tileinfo *ti = ci->home->data;
+ struct tileinfo *ti = ci->home->_data;
if (ci->str || ti->group) {
if (!ci->str || !ti->group)
/* Find the pane displaying given document, preferrably not
* this pane
*/
- struct tileinfo *ti = ci->home->data;
+ struct tileinfo *ti = ci->home->_data;
struct tileinfo *t;
char *name;
DEF_CMD(tile_root)
{
struct pane *p = ci->home;
- struct tileinfo *ti = p->data;
+ struct tileinfo *ti = p->_data;
if (ti->direction != Neither)
return Efallthrough;
DEF_CMD(tile_child_notify)
{
struct pane *p = ci->home;
- struct tileinfo *ti = p->data;
+ struct tileinfo *ti = p->_data;
struct pane *c = ci->focus;
if (c->z)
DEF_CMD(notify_close)
{
/* Private pane received a "close" notification. */
- struct wiggle_data *wd = ci->home->data;
+ struct wiggle_data *wd = ci->home->_data;
int i;
for (i = 0; i < 3; i++)
DEF_CMD_CLOSED(wiggle_close)
{
- struct wiggle_data *wd = ci->home->data;
+ struct wiggle_data *wd = ci->home->_data;
int i;
for (i = 0; i < 3 ; i++) {
DEF_CMD(wiggle_text)
{
/* remember pane, mark1, mark2, num, num2 */
- struct wiggle_data *wd = ci->home->data;
+ struct wiggle_data *wd = ci->home->_data;
struct mark *m2;
char k0 = ci->key[0];
int which = k0 == 'b' ? 1 : k0 == 'a' ? 2 : 0;
DEF_CMD(wiggle_extract)
{
- struct wiggle_data *wd = ci->home->data;
+ struct wiggle_data *wd = ci->home->_data;
struct wtxt *wt;
struct stream str;
/* Set the attribute 'str' on all common ranges in
* 'before' and 'after'
*/
- struct wiggle_data *wd = ci->home->data;
+ struct wiggle_data *wd = ci->home->_data;
const char *attr = ci->str ?: "render:common";
struct stream before, after;
struct file bfile, afile;
DEF_CMD(wiggle_set_wiggle)
{
- struct wiggle_data *wd = ci->home->data;
+ struct wiggle_data *wd = ci->home->_data;
struct stream ostr, astr, bstr;
struct file of, af, bf;
struct csl *csl1, *csl2;
* num2 is max number of lines, defaults to searching whole file.
* Returns number of fuzz lines, plus 1
*/
- struct wiggle_data *wd = ci->home->data;
+ struct wiggle_data *wd = ci->home->_data;
int lines = ci->num2;
struct pane *p = ci->focus;
struct stream str;
DEF_CMD(wiggle_get)
{
- struct wiggle_data *wd = ci->home->data;
+ struct wiggle_data *wd = ci->home->_data;
if (wd->conflicts < 0)
return Einval;
DEF_CMD(find_complete)
{
- char *type = ci->home->data;
+ char *type = ci->home->_data;
if (strstarts(type, "file"))
return emacs_file_complete_func(ci);
DEF_CMD(find_done)
{
int ret;
- char *type = ci->home->data;
+ char *type = ci->home->_data;
char *str = call_ret(strsave, "doc:get-str", ci->focus);
const char *norm = NULL;
struct stat stb;
* walk the list in mru order.
* When we find it, insert the name into ci->focus document
*/
- char *type = ci->home->data;
+ char *type = ci->home->_data;
struct find_helper h;
if (strcmp(type, "doc") != 0)
DEF_CMD(find_attr)
{
- char *type = ci->home->data;
+ char *type = ci->home->_data;
if (!ci->str)
return Enoarg;
DEF_CMD(find_check_replace)
{
char *str, *cp, *sl;
- char *type = ci->home->data;
+ char *type = ci->home->_data;
char *initial_path;
char *prev_dir;
struct stat stb;
int fd;
struct pane *par, *pop, *docp, *p;
struct call_return cr;
- char *type = ci->home->data;
+ char *type = ci->home->_data;
char *initial = attr_find(ci->home->attrs, "initial_path");
int wholebuf = strcmp(type, "file") == 0;
struct mark *st;