Skip to content

Commit 397d637

Browse files
committed
Issue xolox#128: Make saving of GUI font optional
Issue 128 on GitHub: xolox#128
1 parent 5642089 commit 397d637

File tree

3 files changed

+28
-10
lines changed

3 files changed

+28
-10
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ The session load/save prompts are quite verbose by default because they explain
183183

184184
By default this option is set to false (0). When you set this option to true (1) and you start Vim, the session plug-in will open your last used session instead of the default session. Note that the session plug-in will still show you the dialog asking whether you want to restore the last used session. To get rid of the dialog you have to set `g:session_autoload` to `'yes'`.
185185

186+
### The `g:session_persist_font` option
187+
188+
By default the plug-in will save the GUI font with the session to be reused the next time that session is loaded, this can be disabled by adding the following line to your [vimrc script] [vimrc]:
189+
190+
:let g:session_persist_font = 0
191+
186192
### The `g:session_persist_colors` option
187193

188194
By default the plug-in will save the color scheme and the ['background' option] [bg] with the session to be reused the next time that session is loaded, this can be disabled by adding the following line to your [vimrc script] [vimrc]:

autoload/xolox/session.vim

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
" Public API for the vim-session plug-in.
22
"
33
" Author: Peter Odding
4-
" Last Change: July 8, 2015
4+
" Last Change: September 4, 2015
55
" URL: http://peterodding.com/code/vim/session/
66

7-
let g:xolox#session#version = '2.12'
7+
let g:xolox#session#version = '2.13'
88

99
" Public API for session persistence. {{{1
1010

@@ -40,7 +40,9 @@ function! xolox#session#save_session(commands, filename) " {{{2
4040
" the session is restored in a GUI Vim, things will look funky :-).
4141
if has('gui') && is_all_tabs
4242
call add(a:commands, 'set guioptions=' . escape(&go, ' "\'))
43-
call add(a:commands, 'silent! set guifont=' . escape(&gfn, ' "\'))
43+
if xolox#misc#option#get('session_persist_font', 1)
44+
call add(a:commands, 'silent! set guifont=' . escape(&gfn, ' "\'))
45+
endif
4446
endif
4547
call xolox#session#save_globals(a:commands)
4648
if is_all_tabs

doc/session.txt

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ Contents ~
3232
12. The |g:session_autosave_silent| option
3333
13. The |g:session_verbose_messages| option
3434
14. The |g:session_default_to_last| option
35-
15. The |g:session_persist_colors| option
36-
16. The |g:session_persist_globals| option
37-
17. The |g:session_restart_environment| option
38-
18. The |g:session_command_aliases| option
39-
19. The |g:session_menu| option
40-
20. The |g:session_name_suggestion_function| option
41-
21. The |g:loaded_session| option
35+
15. The |g:session_persist_font| option
36+
16. The |g:session_persist_colors| option
37+
17. The |g:session_persist_globals| option
38+
18. The |g:session_restart_environment| option
39+
19. The |g:session_command_aliases| option
40+
20. The |g:session_menu| option
41+
21. The |g:session_name_suggestion_function| option
42+
22. The |g:loaded_session| option
4243
5. Compatibility with other plug-ins |session-compatibility-with-other-plug-ins|
4344
6. Function reference |session-function-reference|
4445
1. Public API for the vim-session plug-in |public-api-for-vim-session-plug-in|
@@ -409,6 +410,15 @@ instead of the default session. Note that the session plug-in will still show
409410
you the dialog asking whether you want to restore the last used session. To get
410411
rid of the dialog you have to set |g:session_autoload| to "'yes'".
411412

413+
-------------------------------------------------------------------------------
414+
The *g:session_persist_font* option
415+
416+
By default the plug-in will save the GUI font with the session to be reused the
417+
next time that session is loaded, this can be disabled by adding the following
418+
line to your |vimrc| script:
419+
>
420+
:let g:session_persist_font = 0
421+
<
412422
-------------------------------------------------------------------------------
413423
The *g:session_persist_colors* option
414424

0 commit comments

Comments
 (0)