In fact, this should only "happen" when you unpin the currently selected note. Inactive tabs are always removed completely. The behavior comes from the current implementation that when you unpin a note, it remains selected. Therefore, the note immediately reappears as a temporary tab.
However, the more I think about the SELECT_LAST_ACTIVE
option, the better I like it. You are right of course that when you unpin a note you have usually finished it and want to move on to the next one. So keeping the old one doesn't make that much sense. Besides, you can still restore the old tab using the history back command.
I will schedule the feature for the next release.
Thanks for sharing your ideas.