Mercurial > vim-lawrencium
diff autoload/lawrencium/cat.vim @ 139:065625e1bb31
Split plugin file into multiple extensions.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Mon, 13 Jun 2016 09:32:34 -0700 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/autoload/lawrencium/cat.vim Mon Jun 13 09:32:34 2016 -0700 @@ -0,0 +1,14 @@ + +function! lawrencium#cat#init() abort + call lawrencium#add_reader('rev', 'lawrencium#cat#read') +endfunction + +function! lawrencium#cat#read(repo, path_parts, full_path) abort + let l:rev = a:path_parts['value'] + if l:rev == '' + call a:repo.ReadCommandOutput('cat', a:full_path) + else + call a:repo.ReadCommandOutput('cat', '-r', l:rev, a:full_path) + endif +endfunction +