aboutsummaryrefslogtreecommitdiffstats
path: root/bundle/github-url
diff options
context:
space:
mode:
authorTeddy Wing2018-04-06 01:21:01 +0200
committerTeddy Wing2018-04-06 01:21:01 +0200
commit4b962150bb8dca9a260858436b8b097d4dfb3b28 (patch)
treec9e3e1a07437c736f012cdbd1fe06fd30acef78f /bundle/github-url
parent5b5fd9c81f20aa37ee5b8f2771a5dc6baafa3bb4 (diff)
downloaddotvim-4b962150bb8dca9a260858436b8b097d4dfb3b28.tar.bz2
github-url: Don't add ending line to URL if it wasn't part of the range
If the command was executed as: :6GitHubFileURL we previously appended `#L6-L6` to the URL. This change appends only `#L6` in that case.
Diffstat (limited to 'bundle/github-url')
-rw-r--r--bundle/github-url/plugin/github_url.vim6
1 files changed, 5 insertions, 1 deletions
diff --git a/bundle/github-url/plugin/github_url.vim b/bundle/github-url/plugin/github_url.vim
index 8f91c56..3eaaba0 100644
--- a/bundle/github-url/plugin/github_url.vim
+++ b/bundle/github-url/plugin/github_url.vim
@@ -16,7 +16,11 @@ function! s:FileURL(include_lines, start_line, end_line)
let lines = ''
if a:include_lines
- let lines = '#L' . a:start_line . '-L' . a:end_line
+ let lines = '#L' . a:start_line
+
+ if a:start_line != a:end_line
+ let lines = lines . '-L' . a:end_line
+ endif
endif
return s:BaseRepoURL() . '/blob/' . current_sha . '/' . current_filename . lines