fixes from feedback.

Also moved away from individual allocations and implemented basic string
views.
This commit is contained in:
Dane Jensen
2026-07-20 15:46:37 -07:00
parent 17778d4082
commit 94f47287fe
4 changed files with 364 additions and 339 deletions

View File

@@ -854,7 +854,7 @@ format_cb_window_layout(struct format_tree *ft)
struct layout_cell *lcroot;
int flags = 0;
if (w == NULL || c == NULL)
if (w == NULL)
return (NULL);
if (w->saved_layout_root != NULL)
@@ -862,7 +862,7 @@ format_cb_window_layout(struct format_tree *ft)
else
lcroot = w->layout_root;
if (c->flags & CLIENT_CONTROL &&
if (c != NULL && c->flags & CLIENT_CONTROL &&
~c->flags & CLIENT_CONTROL_NEWLAYOUTS)
flags |= LAYOUT_CUSTOM_OLD_FORMAT;
return (layout_dump(w, lcroot, flags));
@@ -876,10 +876,10 @@ format_cb_window_visible_layout(struct format_tree *ft)
struct window *w = ft->w;
int flags = 0;
if (w == NULL || c == NULL)
if (w == NULL)
return (NULL);
if (c->flags & CLIENT_CONTROL &&
if (c != NULL && c->flags & CLIENT_CONTROL &&
~c->flags & CLIENT_CONTROL_NEWLAYOUTS)
flags |= LAYOUT_CUSTOM_OLD_FORMAT;
return (layout_dump(w, w->layout_root, flags));

File diff suppressed because it is too large Load Diff

View File

@@ -264,7 +264,7 @@ layout_cell_is_tiled(struct layout_cell *lc)
return is_leaf && !is_floating;
}
static int
int
layout_cell_has_tiled_child(struct layout_cell *lc)
{
struct layout_cell *lcchild;

1
tmux.h
View File

@@ -3815,6 +3815,7 @@ void layout_make_leaf(struct layout_cell *, struct window_pane *);
void layout_make_node(struct layout_cell *, enum layout_type);
void layout_fix_zindexes(struct window *);
int layout_cell_is_tiled(struct layout_cell *);
int layout_cell_has_tiled_child(struct layout_cell *);
int layout_add_horizontal_border(struct layout_cell *,
struct layout_cell *, int);
void layout_fix_offsets(struct window *);