From 3fa8d8396f20dd2f23eb294e03e4fb921c190e6b Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Thu, 3 Jan 2013 18:45:30 -0500 Subject: [PATCH] Better extraction of ns form Goal: not require class path at all. --- plugin/foreplay.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/foreplay.vim b/plugin/foreplay.vim index 14d767b..7f0c97b 100644 --- a/plugin/foreplay.vim +++ b/plugin/foreplay.vim @@ -819,7 +819,10 @@ function! foreplay#ns() abort while lnum < line('$') && getline(lnum) =~# '^\s*\%(;.*\)\=$' let lnum += 1 endwhile - let ns = matchstr(getline(lnum), '\C^(\s*\%(in-ns\s*''\|ns\s\+\)\zs[A-Za-z0-9_?*!+/=<>.-]\+\ze') + let lines = join(getline(lnum, lnum+10), ' ') + 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') if ns !=# '' return ns endif