Look for in-ns when determining buffer namespace

Closes #19.
This commit is contained in:
Tim Pope 2012-12-15 16:26:31 -05:00
parent 0ba2be1e59
commit 79c2bc0730

View File

@ -790,6 +790,14 @@ function! s:tons(path) abort
endfunction
function! foreplay#ns() abort
let lnum = 1
while lnum < line('$') && getline(lnum) =~# '^\s*\%(;.*\)\=$'
let lnum += 1
endwhile
let ns = matchstr(getline(lnum), '\C^(in-ns ''\zs\k\+\ze)')
if ns !=# ''
return ns
endif
let path = s:buffer_path()
return s:tons(path ==# '' ? 'user' : path)
endfunction