Skip to content

Commit ca2e72f

Browse files
committed
Support for BufExplorer windows (issue #12)
1 parent 5d26cab commit ca2e72f

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ This variable isn't really an option but if you want to avoid loading the `sessi
159159

160160
## Compatibility with other plug-ins
161161

162-
Vim's [:mksession][mksession] command isn't fully compatible with plug-ins that create buffers with generated content and because of this `session.vim` includes specific workarounds for such plug-ins:
162+
Vim's [:mksession][mksession] command isn't really compatible with plug-ins that create buffers with generated content and because of this `session.vim` includes specific workarounds for such plug-ins:
163163

164-
* [NERD tree](http://www.vim.org/scripts/script.php?script_id=1658) and [Project](http://www.vim.org/scripts/script.php?script_id=69) windows are supported;
164+
* [BufExplorer](http://www.vim.org/scripts/script.php?script_id=42), [Project](http://www.vim.org/scripts/script.php?script_id=69) and [NERD tree](http://www.vim.org/scripts/script.php?script_id=1658) windows are supported;
165165
* When [shell.vim](http://peterodding.com/code/vim/shell/) is installed Vim's full-screen state is persisted;
166166
* The [netrw](http://vimdoc.sourceforge.net/htmldoc/pi_netrw.html#netrw-start) and [taglist.vim](http://www.vim.org/scripts/script.php?script_id=273) plug-ins support sessions out of the box.
167167

autoload/xolox/session.vim

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
" Vim script
22
" Author: Peter Odding
3-
" Last Change: December 11, 2011
3+
" Last Change: January 15, 2012
44
" URL: http://peterodding.com/code/vim/session/
55

6-
let g:xolox#session#version = '1.4.25'
6+
let g:xolox#session#version = '1.5'
77

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

@@ -126,6 +126,8 @@ function! s:state_filter(line)
126126
" Silence "E95: Buffer with this name already exists" when restoring
127127
" mirrored NERDTree windows.
128128
return '" ' . a:line
129+
elseif a:line =~ '^file .\{-}\[BufExplorer\]$'
130+
return '" ' . a:line
129131
else
130132
return a:line
131133
endif
@@ -168,6 +170,9 @@ function! s:check_special_window(session)
168170
let command = 'NERDTreeMirror'
169171
let argument = ''
170172
endif
173+
elseif expand('%:t') == '[BufExplorer]'
174+
let command = 'BufExplorer'
175+
let argument = ''
171176
elseif exists('g:proj_running') && g:proj_running == bufnr('%')
172177
let command = 'Project'
173178
let argument = expand('%:p')
@@ -325,7 +330,9 @@ function! s:serialize_buffer_state(bufnr)
325330
return a:bufnr . ':' . bufname
326331
endfunction
327332

328-
function! s:prompt(msg, var) " {{{2
333+
" Commands that enable users to manage multiple sessions. {{{1
334+
335+
function! s:prompt(msg, var)
329336
let value = eval(a:var)
330337
if value == 'yes' || (type(value) != type('') && value)
331338
return 1
@@ -337,8 +344,6 @@ function! s:prompt(msg, var) " {{{2
337344
endif
338345
endfunction
339346

340-
" Commands that enable users to manage multiple sessions. {{{1
341-
342347
function! xolox#session#open_cmd(name, bang) abort " {{{2
343348
let name = s:select_name(s:unescape(a:name), 'restore')
344349
if name != ''

doc/session.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -282,15 +282,15 @@ script:
282282
*session-compatibility-with-other-plug-ins*
283283
Compatibility with other plug-ins ~
284284

285-
Vim's |:mksession| command isn't fully compatible with plug-ins that create
285+
Vim's |:mksession| command isn't really compatible with plug-ins that create
286286
buffers with generated content and because of this 'session.vim' includes
287287
specific workarounds for such plug-ins:
288288

289-
- NERD tree [6] and Project [7] windows are supported;
289+
- BufExplorer [6], Project [7] and NERD tree [8] windows are supported;
290290

291-
- When shell.vim [8] is installed Vim's full-screen state is persisted;
291+
- When shell.vim [9] is installed Vim's full-screen state is persisted;
292292

293-
- The netrw (see |netrw-start|) and taglist.vim [9] plug-ins support sessions
293+
- The netrw (see |netrw-start|) and taglist.vim [10] plug-ins support sessions
294294
out of the box.
295295

296296
If your favorite plug-in doesn't work with 'session.vim' drop me a mail and
@@ -316,13 +316,13 @@ Contact ~
316316
If you have questions, bug reports, suggestions, etc. the author can be
317317
contacted at peter@peterodding.com. The latest version is available at
318318
http://peterodding.com/code/vim/session/ and http://github.com/xolox/vim-session.
319-
If you like the script please vote for it on Vim Online [10].
319+
If you like the script please vote for it on Vim Online [11].
320320

321321
===============================================================================
322322
*session-license*
323323
License ~
324324

325-
This software is licensed under the MIT license [11]. Copyright 2011 Peter
325+
This software is licensed under the MIT license [12]. Copyright 2011 Peter
326326
Odding <peter@peterodding.com>.
327327

328328
===============================================================================
@@ -434,11 +434,12 @@ References ~
434434
[3] http://peterodding.com/code/vim/session/#sample_session_script
435435
[4] http://peterodding.com/code/vim/downloads/session.zip
436436
[5] http://peterodding.com/code/vim/reload/
437-
[6] http://www.vim.org/scripts/script.php?script_id=1658
437+
[6] http://www.vim.org/scripts/script.php?script_id=42
438438
[7] http://www.vim.org/scripts/script.php?script_id=69
439-
[8] http://peterodding.com/code/vim/shell/
440-
[9] http://www.vim.org/scripts/script.php?script_id=273
441-
[10] http://www.vim.org/scripts/script.php?script_id=3150
442-
[11] http://en.wikipedia.org/wiki/MIT_License
439+
[8] http://www.vim.org/scripts/script.php?script_id=1658
440+
[9] http://peterodding.com/code/vim/shell/
441+
[10] http://www.vim.org/scripts/script.php?script_id=273
442+
[11] http://www.vim.org/scripts/script.php?script_id=3150
443+
[12] http://en.wikipedia.org/wiki/MIT_License
443444

444445
vim: ft=help

0 commit comments

Comments
 (0)