855 Commits

Author SHA1 Message Date
Andy Stewart
0759c96770 Rename function for clarity. 2014-05-19 14:44:58 +02:00
Andy Stewart
d44c51456a Fix typo in function definition. 2014-05-07 14:10:13 +02:00
Andy Stewart
37883739d9 Update broken link to my portfolio. 2014-05-07 14:05:05 +02:00
Adam Monsen
7908defa0c README: adapt to Vundle interface change
"Bundle" is now "Plugin"

https://github.com/gmarik/Vundle.vim/blob/master/doc/vundle.txt#L345-L369
2014-04-15 08:47:18 -07:00
Andy Stewart
a4347c57ea When disabling, disable across all buffers. 2014-04-14 15:24:25 +02:00
Christian Wellenbrock
47ffb2e30b Follow linked highlight groups to find background colors 2014-04-07 13:35:47 +02:00
Christian Wellenbrock
7e7ccea694 Use bg values from SignColumn for GitGutter{Add,Change,Delete}Default 2014-04-06 00:07:06 +02:00
Andy Stewart
ba0f5930e5 Optimise removal of all signs where possible. 2014-03-24 10:26:36 +01:00
Andy Stewart
0ca3f7e3cd Add hunk previewing. 2014-03-18 13:50:22 +01:00
Andy Stewart
9c66906d56 Move logic out of main plugin file. 2014-03-17 11:27:31 +01:00
Andy Stewart
eee8ba4cff Refactor hunk functionality. 2014-03-17 10:48:05 +01:00
Andy Stewart
fd98657d2f Handle vim versions lacking gettabvar(). 2014-03-14 09:35:54 +01:00
Andy Stewart
a1a29b87ee Use cross-platform way to exit with success.
`exit 0` works across all shells (as far as I know).
2014-02-27 09:42:00 +01:00
Andy Stewart
e9db45e36d Escape grep's argument. 2014-02-26 16:47:47 +01:00
Andy Stewart
aeec864d8d Suppress non-zero exit codes for diff.
Exactly as we do for `grep`.
2014-02-26 16:44:39 +01:00
Andy Stewart
7e8d2fb5a6 Use minimal file paths.
Since we start all external commands by cd'ing to the current file's
directory, we can use the file's name instead of its full path.

The exception is `git show :FILE` where we must use a path relative to
the repo root for maximum git compatibility.  It turns out `git
rev-parse` takes a `--show-prefix` argument which makes our relative
path calculation far simpler.

Minimising files paths has these benefits:

- Easier to inspect the generated commands.
- Less opportunity for escaping problems.
- Eliminates possible mismatches betwen absolute paths generated by git
  and absolute paths generated by Vim (crops up with msys/msys2 on
  Windows).

Thanks to @suxpert for helping with this.
2014-02-26 11:52:38 +01:00
Andy Stewart
973c19e1d5 Don't pester user if their Vim is too old for realtime updates. 2014-02-20 11:56:50 +01:00
Jonathan Warner
dff7bc8736 Wrap compound commands in parentheses.
This fixes a problem on Windows where non-git-tracked files caused an
error in Vim instead of returning normally with a non-zero exit code.
2014-02-20 11:26:50 +01:00
Andy Stewart
f291db08c7 Disable realtime updates when Vim older than 7.3.105. 2014-02-14 12:59:39 +00:00
Andy Stewart
f7368e042f Merge branch 'signs-139'
* signs-139:
  Document variable types.
  Remove orphaned signs.
2014-02-04 12:50:22 +01:00
Andy Stewart
43ae99b3d0 Document variable types. 2014-02-04 12:50:21 +01:00
Andy Stewart
84cb4b8b9d Remove orphaned signs. 2014-02-04 12:49:55 +01:00
Andy Stewart
37491628f4 Add debug command. 2014-02-03 14:13:05 +01:00
Andy Stewart
270973079d Fix bug where updated sign kept old name. 2014-02-03 11:07:54 +01:00
Andy Stewart
468474bedf Custom shellescape(arg) to cope better with Windows.
Hopefully :)
2014-01-31 10:38:04 +01:00
Andy Stewart
8541eec8fc Remove unnecessary escaping.
While I can't say I fully understand escaping rules for Windows, I
understand them better now than I did when I copied that code from
another plugin and hoped for the best.

As far as I can tell, this escaping code was written to be used when
manually constructing a system command to execute – which isn't how this
plugin is written.  So this code shouldn't be here.
2014-01-31 10:04:41 +01:00
Andy Stewart
f016924284 Refactor: inline method. 2014-01-30 16:53:14 +01:00
Andy Stewart
5ac69a8bbc Fix typo in utility#escape(). 2014-01-29 16:10:12 +01:00
Andy Stewart
bd2091a850 Escape the blob filename. 2014-01-29 13:55:58 +01:00
Andy Stewart
974cd952fc Always use path relative to repo root with git-show.
More recent versions of git support paths relative to current directory.
But for maximum compatibility we need to use paths relative to the
file's repo's root.
2014-01-29 13:47:22 +01:00
Jonathan Warner
721c96c8ef Use POSIX and Windows compatible command. 2014-01-29 11:20:29 +01:00
Andy Stewart
c7af455c95 Remove unnecessary shell redirection.
While it is aesthetically nicer to discard the unused output from `git
ls-files`, it isn't necessary.  Discarding requires a shell redirection
which exposes us to vim's shell quirks; it's not worth it.
2014-01-29 10:57:20 +01:00
Andy Stewart
f158fee95e Remove debugging line. 2014-01-27 15:24:04 +01:00
Andy Stewart
5485c37b38 Fix bug in realtime diff of non-current buffer.
This bug meant that a realtime diff of a buffer which wasn't the current
one -- which happens during GitGutterAll() -- diffed the staged version
of the buffer against the current buffer's contents instead of the
buffer's contents.
2014-01-27 14:51:19 +01:00
Andy Stewart
072846e945 Don't place/unplace dummy sign unnecessarily. 2014-01-27 14:15:19 +01:00
Andy Stewart
afecd8711d Fix precedence in diff command. 2014-01-27 13:54:11 +01:00
Andy Stewart
8ada986fcf More accurate error message. 2014-01-27 13:41:05 +01:00
Andy Stewart
f2e08dbeb3 Move git-tracking check into diff command.
This avoids shelling out twice per buffer: once to check whether git
knows about the file and once to perform the diff.  Now we simply do
both in one external call.

Profiling showed external calls to git taking ~20ms.  This doesn't seem
too bad but it adds up.
2014-01-27 10:48:47 +01:00
Andy Stewart
13a11f8935 README improvements. 2014-01-16 12:17:02 +01:00
Andy Stewart
811d9af7a9 Comment code sections. 2014-01-16 11:33:46 +01:00
Andy Stewart
9e99e4d4f1 Neater way to toggle conditional. 2014-01-16 11:33:25 +01:00
Andy Stewart
bb87232842 Add ability to toggle signs on and off. 2014-01-16 11:32:41 +01:00
Andy Stewart
7808f9f647 Fix type of variable when clearing signs. 2014-01-16 11:22:32 +01:00
Andy Stewart
ecdf2e58a1 Whitespace. 2014-01-16 10:42:54 +01:00
Andy Stewart
0537c6945a Use [c and ]c to jump between hunks (changes).
This is more consistent with Vim.
2014-01-15 15:36:13 +01:00
Andy Stewart
6c435e5681 Fix typo in map for staging hunk. 2014-01-14 15:07:22 +01:00
Andy Stewart
ae81dccb67 Add configuration option to disable key maps.
And add a little documentation.
2014-01-13 11:01:14 +01:00
Andy Stewart
c680694b06 Improve sign handling with better data structure.
Using a dictionary instead of a list clarifies the code.
2014-01-13 10:34:41 +01:00
Andy Stewart
da47098496 Fix bug in clearing signs when disabling plugin. 2014-01-13 09:44:26 +01:00
Andy Stewart
dd93685ca3 Proper sentences in bullet points. 2014-01-11 17:26:38 +01:00