From 4b962150bb8dca9a260858436b8b097d4dfb3b28 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 6 Apr 2018 01:21:01 +0200 Subject: 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. --- bundle/github-url/plugin/github_url.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bundle/github-url') 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 -- cgit v1.2.3