summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/key-bindings.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-03-20 18:19:23 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-03-20 18:19:23 +0000
commit756036ae3186081051f40a8fd4dd21a572bd4ccc (patch)
tree98dec2030955a995173aaef15c39c2d1e4d67cb9 /usr.bin/tmux/key-bindings.c
parente1741f7b68851faa67f8737e806710d0953fd59b (diff)
Disable swap entries if nothing to swap with.
Diffstat (limited to 'usr.bin/tmux/key-bindings.c')
-rw-r--r--usr.bin/tmux/key-bindings.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/tmux/key-bindings.c b/usr.bin/tmux/key-bindings.c
index ef3879fd15e..6b11e423127 100644
--- a/usr.bin/tmux/key-bindings.c
+++ b/usr.bin/tmux/key-bindings.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: key-bindings.c,v 1.111 2020/03/20 18:11:56 nicm Exp $ */
+/* $OpenBSD: key-bindings.c,v 1.112 2020/03/20 18:19:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -34,8 +34,8 @@
" 'New Session' 's' {new-session}" \
" 'New Window' 'w' {new-window}"
#define DEFAULT_WINDOW_MENU \
- " 'Swap Left' 'l' {swap-window -t:-1}" \
- " 'Swap Right' 'r' {swap-window -t:+1}" \
+ " '#{?#{>:#{session_windows},1},,-}Swap Left' 'l' {swap-window -t:-1}" \
+ " '#{?#{>:#{session_windows},1},,-}Swap Right' 'r' {swap-window -t:+1}" \
" '#{?pane_marked_set,,-}Swap Marked' 's' {swap-window}" \
" ''" \
" 'Kill' 'X' {kill-window}" \
@@ -57,8 +57,8 @@
" 'Horizontal Split' 'h' {split-window -h}" \
" 'Vertical Split' 'v' {split-window -v}" \
" ''" \
- " 'Swap Up' 'u' {swap-pane -U}" \
- " 'Swap Down' 'd' {swap-pane -D}" \
+ " '#{?#{>:#{window_panes},1},,-}Swap Up' 'u' {swap-pane -U}" \
+ " '#{?#|>:#{window_panes},1},,-}Swap Down' 'd' {swap-pane -D}" \
" '#{?pane_marked_set,,-}Swap Marked' 's' {swap-pane}" \
" ''" \
" 'Kill' 'X' {kill-pane}" \