summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tabbed.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tabbed.c b/tabbed.c
index 93a213a..5bc2b53 100644
--- a/tabbed.c
+++ b/tabbed.c
@@ -1089,8 +1089,8 @@ unmanage(int c) {
spawn(NULL);
}
} else {
- if(c == lastsel) {
- lastsel = -1;
+ if(c && lastsel >= nclients) {
+ lastsel = nclients - 1;
} else if(lastsel > c) {
lastsel--;
}