diff options
author | Teddy Wing | 2018-04-06 01:19:13 +0200 |
---|---|---|
committer | Teddy Wing | 2018-04-06 01:19:13 +0200 |
commit | 5b5fd9c81f20aa37ee5b8f2771a5dc6baafa3bb4 (patch) | |
tree | 50b0395be1ac64d85696439ada03af241c7b68bc | |
parent | 2255d27130b29c578366d6cd0fa41f3af94c1702 (diff) | |
download | dotvim-5b5fd9c81f20aa37ee5b8f2771a5dc6baafa3bb4.tar.bz2 |
github-url: Add `<count>` 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
`<count>`.
-rw-r--r-- | bundle/github-url/plugin/github_url.vim | 6 |
1 files changed, 3 insertions, 3 deletions
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 <SID>FileURL(<line1>, <line2>) +command! -range=0 GitHubFileURL :echo <SID>FileURL(<count>, <line1>, <line2>) |