fix negative arguments to :GoToWindow

This commit is contained in:
Mark Tiefenbruck 2008-05-20 20:48:58 -07:00
parent 079b1b13a0
commit c7ddf2e4e5

View file

@ -168,12 +168,16 @@ void FocusControl::cycleFocus(const FocusableList &window_list,
void FocusControl::goToWindowNumber(const FocusableList &winlist, int num,
const ClientPattern *pat) {
Focusables list = winlist.clientList();
if (num < 0) {
list.reverse();
num = -num;
}
Focusable *win = 0;
Focusables::const_iterator it = winlist.clientList().begin();
Focusables::const_iterator it_end = winlist.clientList().end();
for (; it != it_end && num; ++it) {
Focusables::const_iterator it = list.begin(), it_end = list.end();
for (; num && it != it_end; ++it) {
if (!doSkipWindow(**it, pat) && (*it)->acceptsFocus()) {
num > 0 ? --num : ++num;
--num;
win = *it;
}
}