ZyX_I avatar ZyX_I committed f9bd9fe

@%aurum/maputils: Added possibility to pass preview arguments
Added _r.maputils.readfilewrapper
tests: Fixed maps-log test (added warning messages to .ok file)

Comments (0)

Files changed (4)

autoload/aurum/maputils.vim

         return 0
     endtry
 endfunction
-function s:F.listplugs.commandt.call(files, cbargs)
+function s:F.listplugs.commandt.call(files, cbargs, pvargs)
     let [b:aurum_callback_fun; b:aurum_addargs]=a:cbargs
     ruby $comman_t_old = $command_t
     ruby $command_t = $aurum_command_t
         return 0
     endtry
 endfunction
-function s:F.listplugs.ctrlp.call(files, cbargs)
+function s:F.listplugs.ctrlp.call(files, cbargs, pvargs)
     let s:ctrlp_files=a:files
     call ctrlp#init(s:ctrlp_id)
     let [b:aurum_callback_fun; b:aurum_addargs]=a:cbargs
         return 0
     endtry
 endfunction
-function s:F.listplugs.fuf.call(files, cbargs)
-    " FIXME It is relying on structure of cbargs which should not happen
-    let repo=a:cbargs[1]
-    let rev=a:cbargs[2]
-    call fuf#aurum#setAuVars({'repo': repo, 'rev': rev, 'files': a:files,
-                \             'cbargs': a:cbargs})
+function s:F.listplugs.fuf.call(files, cbargs, pvargs)
+    call fuf#aurum#setAuVars({'files': a:files, 'cbargs': a:cbargs,
+                \                               'pvargs': a:pvargs})
     call fuf#launch('aurum', '', 0)
 endfunction
 "▶1 promptuser
-function s:r.promptuser(files, cbargs)
+function s:r.promptuser(files, cbargs, pvargs)
     if s:plug is 0
         for plug in values(s:F.listplugs)
             if plug.init()
             return call(a:cbargs[0], [a:files[choice-1]]+a:cbargs[1:], {})
         endif
     else
-        return s:plug.call(a:files, a:cbargs)
+        return s:plug.call(a:files, a:cbargs, a:pvargs)
     endif
 endfunction
+"▶1 readfilewrapper :: file, repo, rev → [String]
+function s:r.readfilewrapper(file, repo, rev)
+    return a:repo.functions.readfile(a:repo, a:rev, a:file)
+endfunction
 "▶1 Post maputils resource
 call s:_f.postresource('maputils', s:r)
 "▶1

autoload/fuf/aurum.vim

                 \             self.partialMatching)
 endfunction
 function s:handler.makePreviewLines(word, count)
-    let lines=self._aurum.repo.functions.readfile(self._aurum.repo,
-                \                                 self._aurum.rev, a:word)
+    let lines=call(self._aurum.pvargs[0], [a:word]+self._aurum.pvargs[1:], {})
     return fuf#makePreviewLinesAround(lines, [], a:count,
                 \                     self.getPreviewHeight())
 endfunction

ftplugin/aurumlog.vim

     endif
 endfunction
 "▶1 getfile
-function s:F.getfile(bvar, files, hex, more, cbargs)
+function s:F.getfile(bvar, files, hex, more, cbargs, pvargs)
     if empty(a:files)
         return 0
     endif
     if len(files)==1
         return call(a:cbargs[0], [files[0]]+a:cbargs[1:], {})
     else
-        return s:_r.maputils.promptuser(files, a:cbargs)
+        return s:_r.maputils.promptuser(files, a:cbargs, a:pvargs)
     endif
 endfunction
 "▶1 gethexfile
     let file=0
     let cbargs=copy(a:cbargs)
     let cbargs[0]=s:F.callbacks[cbargs[0]]
+    let pvargs=[s:_r.maputils.readfilewrapper, bvar.repo, hex]
     call extend(cbargs, [bvar, hex], 1)
     if spname=~#'\v^file\d+$'
         " XXX If fileN special exists, then files property was definitely added, 
                     \                                      ((a:more)?
                     \                                           ('allfiles'):
                     \                                           ('files'))),
-                    \        hex, a:more, cbargs)
+                    \        hex, a:more, cbargs, pvargs)
     endif
 endfunction
 "▶1 Callbacks
 | o---+  Changeset 7:c06107b7bcbe751d2dd40faf4179ee7d6aac44ac (branch C)
 | o | |  Changeset 10:c4110a066208167dae46b08f4e0d8d2b37e842f3 (branch C)
 o  Changeset 0:99ea42d70fbe32af955de907352999b1d94bef5f
+>>> Messages:
+Frawor:autoload/aurum/maputils:plinst:If you install Command-T, Ctrlp or FuzzyFinder you will be prompted with much less sucking interface
+Frawor:autoload/aurum/maputils:plinst:If you install Command-T, Ctrlp or FuzzyFinder you will be prompted with much less sucking interface
+Frawor:autoload/aurum/maputils:plinst:If you install Command-T, Ctrlp or FuzzyFinder you will be prompted with much less sucking interface
+Frawor:autoload/aurum/maputils:plinst:If you install Command-T, Ctrlp or FuzzyFinder you will be prompted with much less sucking interface
+Frawor:autoload/aurum/maputils:plinst:If you install Command-T, Ctrlp or FuzzyFinder you will be prompted with much less sucking interface
+Frawor:autoload/aurum/maputils:plinst:If you install Command-T, Ctrlp or FuzzyFinder you will be prompted with much less sucking interface
+Frawor:autoload/aurum/maputils:plinst:If you install Command-T, Ctrlp or FuzzyFinder you will be prompted with much less sucking interface
+<<< Messages^
 {{{1 U
 @  Changeset 4:7e16e7cbaf9ec5b0e65832bc6f057ba825c38cac
 @  Changeset 3:a16a47a8d7aafc115651bfee6f1202093765365d
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.