Skip to content
Snippets Groups Projects
Commit 4664cc7a authored by Peter Odding's avatar Peter Odding
Browse files

Bug fix: Don't persist &go and &gfn when !has('gui') (issue #54)

parent cd6ef28a
Branches
Tags 2.3.11
No related merge requests found
" Vim script " Vim script
" Author: Peter Odding " Author: Peter Odding
" Last Change: June 1, 2013 " Last Change: June 6, 2013
" URL: http://peterodding.com/code/vim/session/ " URL: http://peterodding.com/code/vim/session/
let g:xolox#session#version = '2.3.10' let g:xolox#session#version = '2.3.11'
" Public API for session persistence. {{{1 " Public API for session persistence. {{{1
...@@ -23,7 +23,12 @@ function! xolox#session#save_session(commands, filename) " {{{2 ...@@ -23,7 +23,12 @@ function! xolox#session#save_session(commands, filename) " {{{2
if &verbose >= 1 if &verbose >= 1
call add(a:commands, 'set verbose=' . &verbose) call add(a:commands, 'set verbose=' . &verbose)
endif endif
if is_all_tabs " We save the GUI options only for global sessions, not for tab scoped
" sessions. Also, if the Vim we're currently running in doesn't have GUI
" support, Vim will report &go as an empty string. We should never persist
" this value if the user didn't specifically set it! Otherwise the next time
" the session is restored in a GUI Vim, things will look funky :-).
if has('gui') && is_all_tabs
call add(a:commands, 'set guioptions=' . escape(&go, ' "\')) call add(a:commands, 'set guioptions=' . escape(&go, ' "\'))
call add(a:commands, 'silent! set guifont=' . escape(&gfn, ' "\')) call add(a:commands, 'silent! set guifont=' . escape(&gfn, ' "\'))
endif endif
......
...@@ -6,31 +6,31 @@ Contents ~ ...@@ -6,31 +6,31 @@ Contents ~
1. Introduction |session-introduction| 1. Introduction |session-introduction|
2. Installation |session-installation| 2. Installation |session-installation|
3. Commands |session-commands| 3. Commands |session-commands|
1. The :SaveSession command 1. The |:SaveSession| command
2. The :OpenSession command 2. The |:OpenSession| command
3. The :RestartVim command 3. The |:RestartVim| command
4. The :CloseSession command 4. The |:CloseSession| command
5. The :DeleteSession command 5. The |:DeleteSession| command
6. The :ViewSession command 6. The |:ViewSession| command
7. Tab scoped sessions |tab-scoped-sessions| 7. Tab scoped sessions |tab-scoped-sessions|
1. The :OpenTabSession command 1. The |:OpenTabSession| command
2. The :SaveTabSession command 2. The |:SaveTabSession| command
3. The :AppendTabSession command 3. The |:AppendTabSession| command
4. The :CloseTabSession command 4. The |:CloseTabSession| command
4. Options |session-options| 4. Options |session-options|
1. The sessionoptions setting 1. The |sessionoptions| setting
2. The g:session_directory option 2. The |g:session_directory| option
3. The g:session_default_name option 3. The |g:session_default_name| option
4. The g:session_extension option 4. The |g:session_extension| option
5. The g:session_autoload option 5. The |g:session_autoload| option
6. The g:session_autosave option 6. The |g:session_autosave| option
7. The g:session_autosave_periodic option 7. The |g:session_autosave_periodic| option
8. The g:session_verbose_messages option 8. The |g:session_verbose_messages| option
9. The g:session_default_to_last option 9. The |g:session_default_to_last| option
10. The g:session_persist_globals option 10. The |g:session_persist_globals| option
11. The g:session_restart_environment option 11. The |g:session_restart_environment| option
12. The g:session_command_aliases option 12. The |g:session_command_aliases| option
13. The g:loaded_session option 13. The |g:loaded_session| option
5. Compatibility with other plug-ins |session-compatibility-with-other-plug-ins| 5. Compatibility with other plug-ins |session-compatibility-with-other-plug-ins|
6. Known issues |session-known-issues| 6. Known issues |session-known-issues|
7. Contact |session-contact| 7. Contact |session-contact|
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment