Rewrite tab switching queue
commit0acb273c55869850113f81953772786cd1a8452a
authorJiří Techet <techet@gmail.com>
Sat, 3 Jul 2010 21:49:03 +0000 (3 23:49 +0200)
committerJiří Techet <techet@gmail.com>
Sat, 24 Dec 2011 11:29:51 +0000 (24 12:29 +0100)
treed6f5acc5f24e9cfc7a6e5d0b4235fd81bb4374b8
parentd0892b95d1ed54a2ab0ce411adff210712573899
Rewrite tab switching queue

There was one more bug related to the tab switching. When we switch
so many times that we return back to the original document (so we
actually don't switch at all) then the following switch attempt
doesn't switch immediately to the next document.

After spending two hours thinking what is wrong, I gave up and rewrote
the whole thing in a different way. The problem with the previous
implementation was that before you couldn't just look what's in the queue
"now" - you had to imagine what will be inserted there in the next step
because the switch_in_progress variable was set after the first switch
(this is also why I put the long comment why mru_pos = 2 - that is not
clear at all when you first look at it). Also there were some not very
nice "workarounds" like the idle function that was executed after the
switch and removed the double entry on top of the queue.

So with the new implementation things are much simpler IMO. The queue
starts with the current document and the previously opened documments
follow. It's *always* like that, no exceptions. The idle function
is gone and cb_func_switch_tablastused() is simplified too. The rest of
the functionality should be clear from the code.

Signed-off-by: Jiří Techet <techet@gmail.com>
src/keybindings.c