From 79c2bc0730e35475701fa1182719419aefc8b373 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 15 Dec 2012 16:26:31 -0500 Subject: [PATCH] Look for in-ns when determining buffer namespace Closes #19. --- plugin/foreplay.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugin/foreplay.vim b/plugin/foreplay.vim index 4863c16..6fe1e4c 100644 --- a/plugin/foreplay.vim +++ b/plugin/foreplay.vim @@ -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