Skip to content

Commit 13d405d

Browse files
committed
Ignore "No fold found" errors
1 parent d9af5b1 commit 13d405d

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

autoload/xolox/session.vim

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" Vim script
22
" Author: Peter Odding
3-
" Last Change: June 4, 2011
3+
" Last Change: June 11, 2011
44
" URL: http://peterodding.com/code/vim/session/
55

66
let s:script = expand('<sfile>:p:~')
@@ -101,14 +101,23 @@ function! xolox#session#save_state(commands) " {{{2
101101
call remove(lines, -1)
102102
endif
103103
call xolox#session#save_special_windows(lines)
104-
call extend(a:commands, lines)
104+
call extend(a:commands, map(lines, 's:state_filter(v:val)'))
105105
return 1
106106
finally
107107
let &sessionoptions = ssop_save
108108
call delete(tempfile)
109109
endtry
110110
endfunction
111111

112+
function! s:state_filter(line)
113+
if a:line == 'normal zo'
114+
" Silence "E490: No fold found" errors.
115+
return 'silent! normal zo'
116+
else
117+
return a:line
118+
endif
119+
endfunction
120+
112121
function! xolox#session#save_special_windows(session) " {{{2
113122
" Integration between :mksession, :NERDTree and :Project.
114123
let tabpage = tabpagenr()

plugin/session.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
" Vim script
22
" Author: Peter Odding
3-
" Last Change: June 4, 2011
3+
" Last Change: June 11, 2011
44
" URL: http://peterodding.com/code/vim/session/
5-
" Version: 1.4.6
5+
" Version: 1.4.7
66

77
" Support for automatic update using the GLVS plug-in.
88
" GetLatestVimScripts: 3150 1 :AutoInstall: session.zip

0 commit comments

Comments
 (0)