aboutsummaryrefslogtreecommitdiffstats
path: root/bundle
diff options
context:
space:
mode:
authorTeddy Wing2018-04-06 01:24:04 +0200
committerTeddy Wing2018-04-06 01:24:04 +0200
commit4d07c3d7e2b87113aa18e3198d7205dbaba290c9 (patch)
tree1ac80d944625b672a97498bc5af306a2029914d8 /bundle
parent4b962150bb8dca9a260858436b8b097d4dfb3b28 (diff)
downloaddotvim-4d07c3d7e2b87113aa18e3198d7205dbaba290c9.tar.bz2
github-url: Document functions
Add doc comments to these functions.
Diffstat (limited to 'bundle')
-rw-r--r--bundle/github-url/plugin/github_url.vim8
1 files changed, 6 insertions, 2 deletions
diff --git a/bundle/github-url/plugin/github_url.vim b/bundle/github-url/plugin/github_url.vim
index 3eaaba0..7edf836 100644
--- a/bundle/github-url/plugin/github_url.vim
+++ b/bundle/github-url/plugin/github_url.vim
@@ -1,4 +1,5 @@
-" TODO: doc
+" Constructs a GitHub URL for the current Git repo by making substitutions to
+" the SSH location to turn it into an HTTP URL.
function! s:BaseRepoURL()
let remote = system('git remote get-url origin')
let base_url = substitute(remote, ':', '/', '')
@@ -8,7 +9,10 @@ function! s:BaseRepoURL()
return base_url
endfunction
-" TODO: doc
+" Constructs a GitHub URL to the current file using the current HEAD's SHA. If
+" lines are passed in, these are included in the URL. The `include_lines`
+" argument comes from a `:command`'s `<count>`, and tells the function whether
+" a range was given.
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$', '', '')