[code] [ctags][PATCH 3/4] Handle {tagaddress} containing regular expression search without ^ and $

From: Jens Remus <jens.remus.att.gmail.com>
Date: Thu, 27 Jul 2017 13:59:50 +0200

The Ctags and Exuberant Ctags tags file formats do not mandate the
regular expression pattern (between //) to start with ^ (start of line)
and end with $ (end of line).

---
 init.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/init.lua b/init.lua
index 12197e0..5f6999b 100644
--- a/init.lua
+++ b/init.lua
@@ -70,7 +70,7 @@ local function find_tags(tag)
       local tag, file, ex_cmd, ext_fields = line:match(patt)
       if tag then
         if not file:find('^%a?:?[/\\]') then file = dir..file end
-        if ex_cmd:find('^/') then ex_cmd = ex_cmd:match('^/^(.+)$/$') end
+        if ex_cmd:find('^/') then ex_cmd = ex_cmd:match('^/^?(.-)$?/$') end
         tags[#tags + 1] = {tag, file, ex_cmd, ext_fields}
         found = true
       elseif found then
-- 
2.1.4
-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Thu 27 Jul 2017 - 07:59:50 EDT

This archive was generated by hypermail 2.2.0 : Fri 28 Jul 2017 - 06:36:52 EDT