diff --git a/environ.c b/environ.c index 68e0417b..19f9c327 100644 --- a/environ.c +++ b/environ.c @@ -152,7 +152,8 @@ environ_clear(struct environ *env, const char *name) void environ_put(struct environ *env, const char *var, int flags) { - char *name, *value; + char *name; + const char *value; value = strchr(var, '='); if (value == NULL) diff --git a/format.c b/format.c index cb8761e5..8e63030b 100644 --- a/format.c +++ b/format.c @@ -3778,7 +3778,7 @@ format_table_compare(const void *key0, const void *entry0) } /* Get a format callback. */ -static struct format_table_entry * +static const struct format_table_entry * format_table_get(const char *key) { return (bsearch(key, format_table, nitems(format_table), @@ -4112,7 +4112,7 @@ static char * format_find(struct format_tree *ft, const char *key, int modifiers, const char *time_format) { - struct format_table_entry *fte; + const struct format_table_entry *fte; void *value; struct format_entry *fe, fe_find; struct environ_entry *envent; diff --git a/input-keys.c b/input-keys.c index fdce5409..662b4214 100644 --- a/input-keys.c +++ b/input-keys.c @@ -483,7 +483,7 @@ input_key_vt10x(struct bufferevent *bev, key_code key) { struct utf8_data ud; key_code onlykey; - char *p; + const char *p; static const char *standard_map[2] = { "1!9(0)=+;:'\",<.>/-8? 2", "119900=+;;'',,..\x1f\x1f\x7f\x7f\0\0", diff --git a/input.c b/input.c index 6c9acd07..21920064 100644 --- a/input.c +++ b/input.c @@ -1365,7 +1365,7 @@ input_esc_dispatch(struct input_ctx *ictx) { struct screen_write_ctx *sctx = &ictx->ctx; struct screen *s = sctx->s; - struct input_table_entry *entry; + const struct input_table_entry *entry; if (ictx->flags & INPUT_DISCARD) return (0); @@ -1439,12 +1439,12 @@ input_esc_dispatch(struct input_ctx *ictx) static int input_csi_dispatch(struct input_ctx *ictx) { - struct screen_write_ctx *sctx = &ictx->ctx; - struct screen *s = sctx->s; - struct input_table_entry *entry; - struct options *oo; - int i, n, m, ek, set, p; - u_int cx, bg = ictx->cell.cell.bg; + struct screen_write_ctx *sctx = &ictx->ctx; + struct screen *s = sctx->s; + const struct input_table_entry *entry; + struct options *oo; + int i, n, m, ek, set, p; + u_int cx, bg = ictx->cell.cell.bg; if (ictx->flags & INPUT_DISCARD) return (0); @@ -3225,7 +3225,7 @@ static int input_osc_52_parse(struct input_ctx *ictx, const char *p, u_char **out, int *outlen, char *clip) { - char *end; + const char *end; size_t len; const char *allow = "cpqs01234567"; u_int i, j = 0; diff --git a/key-bindings.c b/key-bindings.c index f1f99cce..08d4c5f6 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -431,13 +431,13 @@ key_bindings_init(void) "bind -N 'Move the visible part of the window left' -r S-Left { refresh-client -L 10 }", "bind -N 'Move the visible part of the window right' -r S-Right { refresh-client -R 10 }", "bind -N 'Reset so the visible part of the window follows the cursor' -r DC { refresh-client -c }", - "bind -N 'Resize the pane up by 5' -r M-Up { resize-pane -U 5 }", + "bind -N 'Resize the pane up by 5' -r M-Up if -F '#{?floating_pane_flag}' { resizep -D-5 } { resize-pane -U 5 }", "bind -N 'Resize the pane down by 5' -r M-Down { resize-pane -D 5 }", - "bind -N 'Resize the pane left by 5' -r M-Left { resize-pane -L 5 }", - "bind -N 'Resize the pane right by 5' -r M-Right { resize-pane -R 5 }", - "bind -N 'Resize the pane up' -r C-Up { resize-pane -U }", + "bind -N 'Resize the pane left by 5' -r M-Left if -F '#{?floating_pane_flag}' { resizep -R-5 } { resize-pane -L 5 }", + "bind -N 'Resize the pane right by 5' -r M-Right resize-pane -R 5", + "bind -N 'Resize the pane up' -r C-Up if -F '#{?floating_pane_flag}' { resizep -D-1 } { resize-pane -U }", "bind -N 'Resize the pane down' -r C-Down { resize-pane -D }", - "bind -N 'Resize the pane left' -r C-Left { resize-pane -L }", + "bind -N 'Resize the pane left' -r C-Left if -F '#{?floating_pane_flag}' { resizep -R-1 } { resize-pane -L }", "bind -N 'Resize the pane right' -r C-Right { resize-pane -R }", /* Menu keys */ diff --git a/layout.c b/layout.c index 1cdab6cb..a91b5cb5 100644 --- a/layout.c +++ b/layout.c @@ -743,6 +743,7 @@ layout_resize_floating_pane(struct window_pane *wp, enum layout_type type, } } +/* Resize a layout cell. */ void layout_resize_layout(struct window *w, struct layout_cell *lc, enum layout_type type, int change, int opposite) @@ -788,8 +789,11 @@ layout_resize_pane(struct window_pane *wp, enum layout_type type, int change, return; /* If this is the last cell, move back one. */ - if (lc == TAILQ_LAST(&lcparent->cells, layout_cells)) - lc = TAILQ_PREV(lc, layout_cells, entry); + if (lc == TAILQ_LAST(&lcparent->cells, layout_cells)) { + do + lc = TAILQ_PREV(lc, layout_cells, entry); + while (lc->flags & LAYOUT_CELL_FLOATING); + } layout_resize_layout(wp->window, lc, type, change, opposite); }