From 4d07c3d7e2b87113aa18e3198d7205dbaba290c9 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Fri, 6 Apr 2018 01:24:04 +0200 Subject: github-url: Document functions Add doc comments to these functions. --- bundle/github-url/plugin/github_url.vim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'bundle/github-url/plugin') 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 ``, 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$', '', '') -- cgit v1.2.3