Skip to content
This repository has been archived by the owner on May 29, 2023. It is now read-only.

NerdTabs added #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions plugin/workspace.vim
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,18 @@ endfunction
function! s:MakeWorkspace(workspace_save_session)
if a:workspace_save_session == 1 || get(s:, 'workspace_save_session', 0) == 1
let s:workspace_save_session = 1
let l:nerd_tree = g:NERDTree.IsOpen()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a check in cases like here where the plugin doesn't exist for a given user?

NERDTreeTabsClose
if s:IsSessionDirectoryUsed()
execute printf('mksession! %s', escape(s:GetSessionDirectoryPath(), '%'))
elseif s:IsAbsolutePath(g:workspace_session_name)
execute printf('mksession! %s', g:workspace_session_name)
else
execute printf('mksession! %s/%s', getcwd(), g:workspace_session_name)
endif
if l:nerd_tree
NERDTreeTabsOpen
endif
endif
endfunction

Expand Down Expand Up @@ -161,6 +166,9 @@ function! s:Autosave(timed)
return
endif

let l:nerd_tree = g:NERDTree.IsOpen()
NERDTreeTabsClose

let current_time = localtime()
let s:last_update = get(s:, 'last_update', 0)
let s:time_delta = current_time - s:last_update
Expand All @@ -176,6 +184,10 @@ function! s:Autosave(timed)
silent! doautocmd BufWritePost % " Periodically trigger BufWritePost.
endif
endif

if l:nerd_tree
NERDTreeTabsOpen
endif
endfunction

function! s:SetAutosave(enable)
Expand Down