Merge branch 'master' into floating_panes

This commit is contained in:
Nicholas Marriott
2026-06-04 14:10:25 +01:00
5 changed files with 11 additions and 63 deletions

View File

@@ -71,11 +71,8 @@ cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item)
struct window *src_w, *dst_w; struct window *src_w, *dst_w;
struct window_pane *src_wp, *dst_wp; struct window_pane *src_wp, *dst_wp;
char *cause = NULL; char *cause = NULL;
int size, dst_idx; int flags = 0, dst_idx;
int flags;
enum layout_type type;
struct layout_cell *lc; struct layout_cell *lc;
u_int curval = 0;
dst_s = target->s; dst_s = target->s;
dst_wl = target->wl; dst_wl = target->wl;
@@ -94,53 +91,13 @@ cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item)
return (CMD_RETURN_ERROR); return (CMD_RETURN_ERROR);
} }
type = LAYOUT_TOPBOTTOM; lc = layout_get_tiled_cell(item, args, dst_w, dst_wp, flags, &cause);
if (args_has(args, 'h'))
type = LAYOUT_LEFTRIGHT;
/* If the 'p' flag is dropped then this bit can be moved into 'l'. */
if (args_has(args, 'l') || args_has(args, 'p')) {
if (args_has(args, 'f')) {
if (type == LAYOUT_TOPBOTTOM)
curval = dst_w->sy;
else
curval = dst_w->sx;
} else {
if (type == LAYOUT_TOPBOTTOM)
curval = dst_wp->sy;
else
curval = dst_wp->sx;
}
}
size = -1;
if (args_has(args, 'l')) {
size = args_percentage_and_expand(args, 'l', 0, INT_MAX, curval,
item, &cause);
} else if (args_has(args, 'p')) {
size = args_strtonum_and_expand(args, 'p', 0, 100, item,
&cause);
if (cause == NULL)
size = curval * size / 100;
}
if (cause != NULL) { if (cause != NULL) {
cmdq_error(item, "size %s", cause); cmdq_error(item, "%s", cause);
free(cause); free(cause);
return (CMD_RETURN_ERROR); return (CMD_RETURN_ERROR);
} }
flags = 0;
if (args_has(args, 'b'))
flags |= SPAWN_BEFORE;
if (args_has(args, 'f'))
flags |= SPAWN_FULLSIZE;
lc = layout_split_pane(dst_wp, type, size, flags);
if (lc == NULL) {
cmdq_error(item, "create pane failed: pane too small");
return (CMD_RETURN_ERROR);
}
layout_close_pane(src_wp); layout_close_pane(src_wp);
server_client_remove_pane(src_wp); server_client_remove_pane(src_wp);

View File

@@ -108,7 +108,8 @@ cmd_split_window_exec(struct cmd *self, struct cmdq_item *item)
else else
lc = layout_get_tiled_cell(item, args, w, wp, flags, &cause); lc = layout_get_tiled_cell(item, args, w, wp, flags, &cause);
if (cause != NULL) { if (cause != NULL) {
cmdq_error(item, "could not create cell: %s", cause); cmdq_error(item, "%s", cause);
free(cause);
return (CMD_RETURN_ERROR); return (CMD_RETURN_ERROR);
} }

View File

@@ -5633,7 +5633,7 @@ format_expand1(struct format_expand_state *es, const char *fmt)
const char *ptr, *s, *style_end = NULL; const char *ptr, *s, *style_end = NULL;
size_t off, len, n, outlen; size_t off, len, n, outlen;
int ch, brackets; int ch, brackets;
char expanded[8192], number[2] = { 0 }; char expanded[8192];
if (fmt == NULL || *fmt == '\0' || !format_check_time(es)) if (fmt == NULL || *fmt == '\0' || !format_check_time(es))
return (xstrdup("")); return (xstrdup(""));
@@ -5763,13 +5763,6 @@ format_expand1(struct format_expand_state *es, const char *fmt)
continue; continue;
default: default:
s = NULL; s = NULL;
if (ch >= '1' && ch <= '9') {
number[0] = ch;
if (format_replace(es, number, 1, &buf, &len,
&off) != 0)
break;
continue;
}
if (fmt > style_end) { /* skip inside #[] */ if (fmt > style_end) { /* skip inside #[] */
if (ch >= 'A' && ch <= 'Z') if (ch >= 'A' && ch <= 'Z')
s = format_upper[ch - 'A']; s = format_upper[ch - 'A'];

3
tmux.1
View File

@@ -7988,9 +7988,6 @@ section.
If If
.Ar argument .Ar argument
values are given, they are available as values are given, they are available as
.Ql #1 ,
.Ql #2
or
.Ql #{1} , .Ql #{1} ,
.Ql #{2} .Ql #{2}
and so on. and so on.

View File

@@ -42,7 +42,7 @@ static void window_copy_formats(struct window_mode_entry *,
struct format_tree *); struct format_tree *);
static struct screen *window_copy_get_screen(struct window_mode_entry *); static struct screen *window_copy_get_screen(struct window_mode_entry *);
static void window_copy_scroll1(struct window_mode_entry *, static void window_copy_scroll1(struct window_mode_entry *,
struct window_pane *wp, int, u_int, u_int, int); struct window_pane *, int, u_int, u_int, int);
static void window_copy_pageup1(struct window_mode_entry *, int); static void window_copy_pageup1(struct window_mode_entry *, int);
static int window_copy_pagedown1(struct window_mode_entry *, int, int); static int window_copy_pagedown1(struct window_mode_entry *, int, int);
static void window_copy_next_paragraph(struct window_mode_entry *); static void window_copy_next_paragraph(struct window_mode_entry *);
@@ -657,10 +657,10 @@ window_copy_scroll1(struct window_mode_entry *wme, struct window_pane *wp,
* dragging this y point relative to top of slider. * dragging this y point relative to top of slider.
* *
* my is a raw tty y coordinate; sb_top (= wp->yoff) is a window * my is a raw tty y coordinate; sb_top (= wp->yoff) is a window
* coordinate. Convert my to window coordinates by adding tty_oy * coordinate. Convert my to window coordinates by adding tty_oy (the
* (the window pan offset). sl_mpos already has the statuslines * window pan offset). sl_mpos already has the status lines adjustment
* adjustment baked in (see server_client_check_mouse), so no further * baked in (see server_client_check_mouse), so no further status lines
* statuslines correction is needed here. * correction is needed here.
*/ */
my_w = my + tty_oy; my_w = my + tty_oy;
if (my_w <= sb_top + (u_int)sl_mpos) { if (my_w <= sb_top + (u_int)sl_mpos) {