tabbed-move-clamped-20200404-e2ca5f9.diff (331B)
1 diff --git a/tabbed.c b/tabbed.c 2 index eafe28a..e2ca5f9 100644 3 --- a/tabbed.c 4 +++ b/tabbed.c 5 @@ -787,8 +787,12 @@ maprequest(const XEvent *e) 6 void 7 move(const Arg *arg) 8 { 9 - if (arg->i >= 0 && arg->i < nclients) 10 - focus(arg->i); 11 + int i; 12 + 13 + i = arg->i < nclients ? arg->i : nclients - 1; 14 + 15 + if (i >= 0) 16 + focus(i); 17 } 18 19 void