xolox/vim-session — pull request #35 by inkarkat (2012-12-04 12:30:25+00:00)
Title: ENH: Create session for current tab page only.

Depending on whether `'sessionoptions'` contains `"tabpages"`, GUI, font, features, colors, fullscreen are not persisted. Together with new `:SaveTabSession`, ... commands (only defined when the default `'sessionoptions'` persist all tabs; otherwise, the original commands are enough and now work on single tab pages), this allows a more lightweight form of persistence limited to a single tab page. When such a single-tab session is restored, it also only deletes the buffers that were solely visible in the current tab page, and it replaces only the windows in that tab page. Additionally, a new `:AppendTabSession` command allows to add the session as a new tab page.

Public API functions `xolox#session#is_tabsession()` and `xolox#session#session_name()` have been added for use e.g. in `'titlestring'`.

A limitation of the current implementation is that multiple (tab-only and/or global) sessions cannot be handled concurrently; due to the script-local variables, there's only a single notion of "current session", but that shouldn't matter that much in practice.

Note that I haven't updated the documentation yet, but I can add a commit when you indicate that you're willing to accept this enhancement.