Do not count arguments starting - as optional arguments, makes old

resize-pane syntax work. GitHub issue 5275, based on a changed from Dane
Jensen.
This commit is contained in:
nicm
2026-06-26 09:54:56 +00:00
parent 8e79c4a03d
commit dd2fef6673
2 changed files with 21 additions and 5 deletions

View File

@@ -18,6 +18,7 @@
#include <sys/types.h>
#include <ctype.h>
#include <stdlib.h>
#include <string.h>
@@ -63,8 +64,7 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item)
const char *errstr, *argval;
const char flags[4] = { 'U', 'D', 'L', 'R' };
char *cause = NULL, flag;
u_int opposite = 0;
int adjust, x, y, status;
int adjust, x, y, status, opposite = 0;
long unsigned i;
struct grid *gd = wp->base.grid;
@@ -147,8 +147,12 @@ cmd_resize_pane_exec(struct cmd *self, struct cmdq_item *item)
continue;
argval = args_get(args, flag);
if (argval == NULL)
argval = "1";
if (argval == NULL) {
if (args_count(args) == 0)
argval = "1";
else
argval = args_string(args, 0);
}
adjust = strtonum(argval, INT_MIN, INT_MAX, &errstr);
if (errstr != NULL) {