Thanks Felipe, this new patch is much cleaner than mine. Just two comments: 1. Due to the way single windows are now detected, layouts with multiple tabs but single windows on each of them do not work. Example: layout = LOCAL + BASE + REMOTE + MERGED (we should probably add a test case for this) I noticed it did also not work in "master" (but it looks like it does in the patch I sent yesterday) 2. Tabs with a single window are not highlighted (this was also a problem in "master", I just noticed this when testing your changes) I'll try to figure out how to fix this (but I won't be able to do so until tomorrow). Thanks.