From 5b5fd9c81f20aa37ee5b8f2771a5dc6baafa3bb4 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 6 Apr 2018 01:19:13 +0200 Subject: github-url: Add `` to command Using a `count` of 0 allows us to determine in `s:FileURL` whether a range was given on the command line. This count needs to be passed into the function explicitly with ``. --- bundle/github-url/plugin/github_url.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bundle/github-url/plugin') diff --git a/bundle/github-url/plugin/github_url.vim b/bundle/github-url/plugin/github_url.vim index a6d8e87..8f91c56 100644 --- a/bundle/github-url/plugin/github_url.vim +++ b/bundle/github-url/plugin/github_url.vim @@ -9,13 +9,13 @@ function! s:BaseRepoURL() endfunction " TODO: doc -function! s:FileURL(start_line, end_line) +function! s:FileURL(include_lines, start_line, end_line) let current_sha = system('git show --format="format:%H"') let current_sha = substitute(current_sha, '\n$', '', '') let current_filename = expand('%') let lines = '' - if a:start_line && a:end_line + if a:include_lines let lines = '#L' . a:start_line . '-L' . a:end_line endif @@ -23,4 +23,4 @@ function! s:FileURL(start_line, end_line) endfunction " echo s:FileURL() -command! -range GitHubFileURL :echo FileURL(, ) +command! -range=0 GitHubFileURL :echo FileURL(, , ) -- cgit v1.2.3