1. ZyX_I
  2. aurum

Commits

ZyX_I  committed 07556e1

Added `a' (annotate) mapping to glog buffer

  • Participants
  • Parent commits 51377f5
  • Branches default

Comments (0)

Files changed (3)

File ftplugin/aurumgraphlog.vim

View file
     endif
     let bvar=s:_r.aurum.bufvars[bufnr('%')]
     let epath=escape(bvar.repo.path, ':\')
-    return ':edit '.fnameescape('aurum://file:'.epath.':'.hex.':'.file)."\n"
+    return ":wincmd c\n:edit ".
+                \fnameescape('aurum://file:'.epath.':'.hex.':'.file)."\n"
+endfunction
+"▶1 annotate
+function s:F.annotate()
+    let r=s:F.open()
+    if empty(r)
+        return r
+    else
+        return r.":AuAnnotate\n"
+    endif
 endfunction
 "▶1 vimdiff
 function s:F.vimdiff(...)
                 \               'crrestrict:files')."\n"
 endfunction
 "▶1 AuGlog mapping group
-" TODO U (update) and a (annotate) mappings
+" TODO U (update) mapping
 call s:_f.mapgroup.add('AuGlog', {
             \   'Enter': {'lhs': "\n", 'rhs': [],                             },
             \    'File': {'lhs': 'gF', 'rhs': s:F.filehistory                 },
             \    'Next': {'lhs':  'K', 'rhs': s:F.next                        },
             \    'Prev': {'lhs':  'J', 'rhs': s:F.prev                        },
             \    'Open': {'lhs':  'o', 'rhs': s:F.open                        },
+            \'Annotate': {'lhs':  'a', 'rhs': s:F.annotate                    },
             \}, {'func': s:F.cr, 'silent': 1, 'mode': 'n'})
 "▶1
 execute frawor#Lockvar(s:, '_r')

File test/glogmaps.in

View file
 o0
 :call WriteFile(bufname('%'))
 :bwipeout!
+:W{{{1 a+files
+:R AuGlog showfiles
+/Files: /e+2
+a:call WriteFile(bufname('%'), bufname(winbufnr(winnr('#'))), 'w$: '.winnr('$'))
+:bwipeout!
+:bwipeout!
+:W{{{1 a
+:R AuGlog showfiles
+/Files: .*,/-1
+a2
+:call WriteFile(bufname('%'), bufname(winbufnr(winnr('#'))), 'w$: '.winnr('$'))
+:bwipeout!
+:bwipeout!
+:W{{{1 cancel a
+:R AuGlog showfiles
+/Files: .*,/-1
+a0
+:call WriteFile(bufname('%'))
+:bwipeout!
 :source addmessages.vim

File test/glogmaps.ok

View file
 aurum://file:%TMPDIR%/test/glogmapsrepo:a02f2fc6c51afe07a34bd65f5f8bb69d74105054:hglines.lst
 {{{1 cancel o
 aurum://glog:%TMPDIR%/test/glogmapsrepo:showfiles:1,
+{{{1 a+files
+aurum://file:%TMPDIR%/test/glogmapsrepo:bd8865085771912fc9ab56425f385a1751696ec1:.hgignore
+aurum://annotate:%TMPDIR%/test/glogmapsrepo:bd8865085771912fc9ab56425f385a1751696ec1:.hgignore
+w$: 2
+{{{1 a
+aurum://file:%TMPDIR%/test/glogmapsrepo:a02f2fc6c51afe07a34bd65f5f8bb69d74105054:hglines.lst
+aurum://annotate:%TMPDIR%/test/glogmapsrepo:a02f2fc6c51afe07a34bd65f5f8bb69d74105054:hglines.lst
+w$: 2
+{{{1 cancel a
+aurum://glog:%TMPDIR%/test/glogmapsrepo:showfiles:1,