When using ace for a tabbed editor (like in c9), there is one instance of editor, and every document is in session, switching editor tabs changes the session with editor.setSession, document popup in the kitchen-sink uses the same mechanism.
When changing tabs, i'd expect markMode either to be false, or be restored to the value from that tab.