diff options
| author | Teddy Wing | 2018-04-06 01:21:01 +0200 | 
|---|---|---|
| committer | Teddy Wing | 2018-04-06 01:21:01 +0200 | 
| commit | 4b962150bb8dca9a260858436b8b097d4dfb3b28 (patch) | |
| tree | c9e3e1a07437c736f012cdbd1fe06fd30acef78f /bundle/github-url | |
| parent | 5b5fd9c81f20aa37ee5b8f2771a5dc6baafa3bb4 (diff) | |
| download | dotvim-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.vim | 6 | 
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 | 
