From 5aa33b2ccaa43a48526912ef8a5b36a15346d84d Mon Sep 17 00:00:00 2001 From: Jacek Lach Date: Tue, 9 Apr 2013 12:07:21 +0100 Subject: [PATCH] Handle single keyword metadata on namespace name I.e. (ns ^:integration my-namespace) --- plugin/fireplace.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/fireplace.vim b/plugin/fireplace.vim index d0f8ca7..0afcf53 100644 --- a/plugin/fireplace.vim +++ b/plugin/fireplace.vim @@ -1007,10 +1007,12 @@ function! fireplace#ns() abort while lnum < line('$') && getline(lnum) =~# '^\s*\%(;.*\)\=$' let lnum += 1 endwhile + let keyword_group = '[A-Za-z0-9_?*!+/=<>.-]' let lines = join(getline(lnum, lnum+50), ' ') let lines = substitute(lines, '"\%(\\.\|[^"]\)*"\|\\.', '', 'g') let lines = substitute(lines, '\^\={[^{}]*}', '', '') - let ns = matchstr(lines, '\C^(\s*\%(in-ns\s*''\|ns\s\+\)\zs[A-Za-z0-9_?*!+/=<>.-]\+\ze') + let lines = substitute(lines, '\^:'.keyword_group.'\+', '', 'g') + let ns = matchstr(lines, '\C^(\s*\%(in-ns\s*''\|ns\s\+\)\zs'.keyword_group.'\+\ze') if ns !=# '' return ns endif