Commits

ZyX_I  committed 31921bd Merge

Merge

  • Participants
  • Parent commits 6c770f8, 0a9599e
  • Branches merge

Comments (0)

Files changed (11)

File autoload/aurum/drivers/bazaar.vim

     return r
 endfunction
 "▶1 bzr.diffre :: _, opts → Regex
-let s:diffre='\m^=== \v(\a+)\ file\ (.*)'
+let s:diffre='\m\C^=== \v(\a+)\ file\ (.*)'
 function s:bzr.diffre(repo, opts)
     return s:diffre
 endfunction

File autoload/aurum/drivers/git.vim

     return r
 endfunction
 "▶1 git.diffre :: _, opts → Regex
-let s:diffre='\m^diff --git \v((\")?%s\/.{-}\2) \2%s\/'
+let s:diffre='\m\C^diff --git \v((\")?%s\/.{-}\2) \2%s\/'
 function s:git.diffre(repo, opts)
     if get(a:opts, 'reverse', 0)
         return printf(s:diffre, 'b', 'a')

File autoload/aurum/drivers/mercurial.vim

     " XXX first characters must be identical for hg.getstats(), but it must not 
     " match lines not containing filename for getdifffile()
     if get(a:opts, 'git', 0)
-        return '\m^diff \V--git a/\(\.\{-}\) b/'
+        return '\m\C^diff \V--git a/\(\.\{-}\) b/'
     else
-        return '\m^diff \v.*\-r\ \w+\s(.*)$'
+        return '\m\C^diff \v.*\-r\ \w+\s(.*)$'
     endif
 endfunction
 "▶1 hg.getrepoprop :: repo, prop → a

File autoload/aurum/drivers/subversion.vim

 endfunction
 "▶1 svn.diffre :: _, opts → Regex
 function s:svn.diffre(repo, opts)
-    return '\m^Index: \v(.*)'
+    return '\m\C^Index: \v(.*)'
 endfunction
 "▶1 svn.getrepoprop :: repo, propname → a
 function s:svn.getrepoprop(repo, prop)

File autoload/aurum/edit.vim

         \}, '"Error while registering command %s for plugin %s: ".v:val'))
 "▶1 globtopat :: glob[, catchstars] → pattern
 function s:F.globtopat(glob, ...)
-    let r='\V\^'
+    let r='\V\C\^'
     let g=substitute(a:glob, '\V//\+', '/', 'g')
     if g[-1:] is# '/'
         let g=g[:-2]
 "▶1 ounescape :: String → String
 let s:unecodes={}
 call map(copy(s:ecodes), 'extend(s:unecodes, {v:val : v:key}, "error")')
-let s:unepattern='\V%\(\['.escape(join(keys(s:unecodes), ''), '\]-^').']\)'
+let s:unepattern='\V\C%\(\['.escape(join(keys(s:unecodes), ''), '\]-^').']\)'
 function s:F.ounescape(str)
     if substitute('a', '.', '\="a"', '') is# 'a'
         return substitute(a:str, s:unepattern, '\=s:unecodes[submatch(1)]', 'g')

File autoload/aurum/log/templates.vim

                 for i in spsets
                     let func[i]=substitute(substitute(substitute(substitute(
                                 \func[i],
-                                \'\Vlen(text[-1])', lstr,  'g'),
+                                \'\V\Clen(text[-1])', lstr,  'g'),
                                 \'\v\ (\d+%([+\-]\d+)+)',
                                 \       '\='.tr(s:addexpr, '+', '1'),
-                                \                          'g'),
-                                \'\Vlen(text)',     '&+1', 'g'),
-                                \'\Vlen(text)\v(%([+\-]\d+)+)',
+                                \                            'g'),
+                                \'\V\Clen(text)',     '&+1', 'g'),
+                                \'\V\Clen(text)\v(%([+\-]\d+)+)',
                                 \       '\="len(text)".'.s:addexpr,
-                                \                          'g')
+                                \                            'g')
                 endfor
                 let func+=['let text+=['.str.'.'.a:s.']']
                 return
                 "▲3
                 let expr=substitute(substitute(substitute(substitute(
                             \substitute(expr,
-                            \'\V@@@', marg,      'g'),
-                            \'\V@.@', 'a:cs',    'g'),
-                            \'\V@:@', 'a:repo',  'g'),
-                            \'\V@o@', 'a:opts',  'g'),
-                            \'\V@-@', 'a:width', 'g')
+                            \'\V\C@@@', marg,      'g'),
+                            \'\V\C@.@', 'a:cs',    'g'),
+                            \'\V\C@:@', 'a:repo',  'g'),
+                            \'\V\C@o@', 'a:opts',  'g'),
+                            \'\V\C@-@', 'a:width', 'g')
                 "▶2 Process positional parameters
                 for j in range(len(ke)-2)
                     let expr=substitute(expr, '@'.j.'@',

File autoload/aurum/move.vim

     elseif a:0==2 && a:2=~#'[*?]' &&
                 \substitute(a:1, '\v%(^|$|\\.|[^*])[^*?]*', '-', 'g') is#
                 \substitute(a:2, '\v%(^|$|\\.|[^*])[^*?]*', '-', 'g')
-        let pattern=s:_r.globtopat(repo.functions.reltorepo(repo, a:1),
-                    \                       1)
+        let pattern=s:_r.globtopat(repo.functions.reltorepo(repo, a:1), 1)
         let repl=split(a:2, '\V\(**\?\|?\)', 1)
         let moves={}
         for [file, match] in filter(map(copy(allfiles),

File autoload/aurum/record.vim

         execute swnr.'wincmd w'
         return s:F.runstatmap('commit')
     elseif a:action is# 'discardall'
+        " First discard. Otherwise when wiping out left buffer it may trigger 
+        " writing contents to the file.
+        call s:F.runleftmap('discard')
         execute swnr.'wincmd w'
         return s:F.runstatmap('discard')
     elseif a:action is# 'remove'

File ftplugin/aurumannotate.vim

             execute lnr
         elseif exists('line')
             0
-            call search('\V\^'.escape(line, '\').'\$', 'cW')
+            call search('\V\C\^'.escape(line, '\').'\$', 'cW')
             let lnr=line('.')
             wincmd p
             execute lnr

File test/cmd-record.in

 :Run 0
 :bwipeout!
 :
+:W{{{1 edit-discardall
+:R let g:oldhglines=readfile('hglines.lst', 'b')
+:R call writefile(['abcdef'], 'hglines.lst', 'b')
+:R AuRecord
+0:let g:fname=getline('.')[3:]
+:R let g:lines=readfile(g:fname, 'b')
+O,X
+:
+:
+:R let g:new_lines=readfile(g:fname, 'b')
+:R call WriteFile(glob('*.orig'))
+:if g:lines !=# g:new_lines | call WriteFile(['Lines differ for file '.g:fname.' (TEST FAILURE):', '{{{ old'] + g:lines + ['}}}', '{{{ new'] + g:new_lines + ['}}}']) | else | call WriteFile(['Lines do not differ for '.g:fname.' (expected)', '{{{'] + g:lines + ['}}}']) | endif
+:R call writefile(g:oldhglines, 'hglines.lst', 'b')
 :source addmessages.vim

File test/cmd-record.ok

 ^? 3
 After second remove: 3
 -? 3
+{{{1 edit-discardall
+Lines do not differ for hglines.lst (expected)
+{{{
+abcdef
+}}}
 >>> Messages: