Age | Commit message (Collapse) | Author |
|
If the `:pwd` was a subdirectory of the repository root, the path in the
constructed GitHub URL would not include any subdirectories up to and
including the current working directory. This created an incorrect path
in the URL, resulting in a 404.
|
|
Previously all we did was `echo` the generated URL to the command line.
This was mainly for debugging purposes, but it strikes me that this
would be nice to keep so that users can validate that the correct URL
was generated.
In addition to doing this, though, we need to provide an easy way to
send that URL string into other programs like chat or an input field in
a web browser. Copy the URL to the Mac OS X clipboard to make it easier
to share.
|
|
If there's a diff in the index, that will get included in the output of
this command, meaning that just after the SHA, there will be a
multi-line diff string that completely messes up the constructed URL.
Use the `--no-patch` flag to suppress diff output.
|
|
Improve performance by eliminating the functions from the `plugin` file.
Also introduces a new `github_url#GitHubURL()` function that serves as
an entry point into the plugin.
Add a `g:loaded_github_url` check to prevent plugin re-sourcing and be a
good Vim citizen.
|
|
I used this for testing purposes but it's no longer relevant.
|
|
Add doc comments to these functions.
|
|
If the command was executed as:
:6GitHubFileURL
we previously appended `#L6-L6` to the URL. This change appends only
`#L6` in that case.
|
|
Using a `count` of 0 allows us to determine in `s:FileURL` whether a
range was given on the command line.
This count needs to be passed into the function explicitly with
`<count>`.
|
|
A rough working implementation of a plugin that generates a GitHub URL
for the current file.
It gets the base URL from the current Git repo's `origin` remote and
uses the current commit SHA. Lines can also be highlighted by passing a
range to the command.
This makes it easier to share a bit of code that I see in the editor
with other people on my team in chat or the issue tracker.
|