Use window target if specified and exists even when looking for an

index, fixes neww -a with -t as well.
This commit is contained in:
nicm
2018-05-03 16:56:59 +00:00
parent 896c1da7da
commit e24a077752
2 changed files with 7 additions and 6 deletions

View File

@ -63,7 +63,7 @@ cmd_new_window_exec(struct cmd *self, struct cmdq_item *item)
struct environ_entry *envent;
struct cmd_find_state fs;
if (args_has(args, 'a')) {
if (args_has(args, 'a') && wl != NULL) {
if ((idx = winlink_shuffle_up(s, wl)) == -1) {
cmdq_error(item, "no free window indexes");
return (CMD_RETURN_ERROR);