From e7192c06b364a043e29916dc883a101742f76b0c Mon Sep 17 00:00:00 2001 From: Nick K Date: Thu, 10 Sep 2015 15:06:46 +0300 Subject: [PATCH 1/2] Fixed commit-retrieving regex --- plugin/double-tap.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/double-tap.vim b/plugin/double-tap.vim index 1b76f2b..bcebe16 100644 --- a/plugin/double-tap.vim +++ b/plugin/double-tap.vim @@ -35,8 +35,8 @@ endif let g:loaded_doubletap = 1 " }}} -let s:pattern = '\([b,]\|^\):\zs\([^,]\+\)' " This patterns finds the wanted - " item in 'comments' +let s:pattern = '\v,:\zs([^,:]+)' " This patterns finds the wanted + " item in 'comments' let s:commStart = {} " dict to hold the comment starters using " the current filetype as key From 6f73e784b8b6b3125d662222dbc0e003637b4425 Mon Sep 17 00:00:00 2001 From: Nick K Date: Thu, 10 Sep 2015 16:21:55 +0300 Subject: [PATCH 2/2] Created new comment extraction regex. Detection regex is broken for now --- plugin/double-tap.vim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugin/double-tap.vim b/plugin/double-tap.vim index bcebe16..ac03361 100644 --- a/plugin/double-tap.vim +++ b/plugin/double-tap.vim @@ -35,8 +35,8 @@ endif let g:loaded_doubletap = 1 " }}} -let s:pattern = '\v,:\zs([^,:]+)' " This patterns finds the wanted - " item in 'comments' +let s:pattern = '\v(,[^sme][0-9]*|,|^):\zs[^,]+' " This patterns finds the wanted + " item in 'comments' let s:commStart = {} " dict to hold the comment starters using " the current filetype as key @@ -50,9 +50,10 @@ function! s:Detect_empty_comment() endif " Captures the comment starter if necessary; only once per filetype if !has_key(s:commStart, &ft) - let s:commStart[&ft] = matchstr(&comments, s:pattern) + let s:commStart[&ft] = join(matchlist(&comments, s:pattern),'q') endif let line = getline('.') + echom s:commStart[&ft] if s:commStart[&ft] != '' && line =~ '^\s*\V'. s:commStart[&ft] . '\m\s*$' return "\" else