ZyX_I committed 433e831

**: Added explicit /\C to match* calls where appropriate
ftplugin/diff: Improved foldtext function

Comments (0)

Files changed (4)


 "          It also seems impossible to download bundle with older version of 
 "          gist.
 let s:ghpath='substitute(path, "\\v^[:/]|\\.git$", "", "g")'
-let s:roproj='matchstr(path, ''\v\/@<=[^/]{-1,}%(%(\.git)?\/*$)@='').".git"'
+let s:roproj='matchstr(path, ''\C\v\/@<=[^/]{-1,}%(%(\.git)?\/*$)@='').".git"'
 let s:robase='"http://".domain."/w/".'.s:roproj
 let s:godomain='substitute(domain, "^git\\.", "", "")'
 let s:gobase='"http://".'.s:godomain.'."/".'.s:ghpath


     elseif a:prop is# 'url'
         let lines=s:F.hg(a:repo, 'showconfig', ['paths'], {}, 0, 'sc')[:-2]
         let confs={}
-        call map(lines, 'matchlist(v:val, ''\v^paths\.([^=]+)\=(.*)$'')[1:2]')
+        call map(lines, 'matchlist(v:val, ''\C\v^paths\.([^=]+)\=(.*)$'')[1:2]')
         call map(copy(lines), 'extend(confs, {v:val[0]: v:val[1]})')
         if has_key(confs, 'default-push')
             return confs['default-push']


     let r={}
     let i=0
     while !empty(s)
-        let key=matchstr(s, '\v^%(expr|synreg|flbeg|pref|suf):')[:-2]
+        let key=matchstr(s, '\C\v^%(expr|synreg|flbeg|pref|suf):')[:-2]
         if empty(key)
             let arg=matchstr(s, '\v(\\.|[^,])*')
             let s=s[len(arg)+1:]
     let line=getline(v:foldstart)
     if v:foldlevel==1
         if line =~# '\v^diff%(\ --git)?\ a\/(.{-})\ b\/\1'
-            return matchlist(line, '\v^diff%(\ --git)\ a\/(.{-})\ b\/\1')[1]
+            return matchlist(line, '\C\v^diff%(\ --git)\ a\/(.{-})\ b\/\1')[1]
         elseif line =~# '\v^diff%(\ \-r\ \x+){1,2}'
-            return substitute(line, '\v^diff%(\ \-r\ \x+){1,2}\ ', '', '')
+            return substitute(line, '\C\v^diff%(\ \-r\ \x+){1,2}\ ', '', '')
+        elseif line[:4] is# 'diff '
+            return line[5:]
+        else
+            return line
     elseif v:foldlevel==2
         return substitute(line, '\m^@@[^@]\+@@ ', '', '')