Skip to content

Commit 49f5626

Browse files
author
Minh-Tam TRAN
committed
Update existing buffers whose sln_or_dir exist but are not in the running_servers list
1 parent 561a662 commit 49f5626

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

autoload/OmniSharp/actions/workspace.vim

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ function! s:ProjectsRH(job, response) abort
3030
call OmniSharp#log#Log(a:job, 'Workspace complete: no projects')
3131
call OmniSharp#project#RegisterLoaded(a:job)
3232
endif
33+
34+
let projectFolders = mapnew(projects, {_,p -> fnamemodify(p.path, ':p:h') })
35+
for i in filter(range(1, bufnr('$')), {_,x -> bufexists(x) && !empty(getbufvar(x, "OmniSharp_host"))})
36+
let host = getbufvar(i, "OmniSharp_host")
37+
if index(projectFolders, host.sln_or_dir) < 0 || !host.initialized
38+
let filePath = fnamemodify(bufname(i), ':p')
39+
for projectFolder in projectFolders
40+
if stridx(filePath, projectFolder) == 0
41+
let host.sln_or_dir = a:job.sln_or_dir
42+
break
43+
endif
44+
endfor
45+
endif
46+
endfor
3347
endfunction
3448

3549
let &cpoptions = s:save_cpo

0 commit comments

Comments
 (0)