244 Commits

Author SHA1 Message Date
Andy Stewart
f2e794b484 Always use realtime diff when buffer is modified.
This was motivated by Vim regaining focus into a buffer with unsaved
changes, and the realtime diff being replaced with an out of date disk
diff.  With this commit the realtime diff will be run again.
2013-12-07 14:42:45 +00:00
Jakob Rath
cdfde92a15 Use correct line ending for realtime diff. 2013-12-07 14:00:07 +00:00
Suraj N. Kurapati
c5872cd042 support using POSIX sh(1) as set shell=/bin/sh
Use `cd` instead of `popd` because POSIX sh(1) does not have `pushd` and
also because this plugin did not pair its `pushd` with a `popd` anyway.

Use file redirection because POSIX sh(1) does not have anonymous pipes.
2013-09-25 10:42:13 -07:00
Bailey Ling
c44f4b8be6 Fix calculation of removed lines for hunk summary. 2013-08-21 11:30:10 +02:00
Wilson Y. Wong
6955f6dc91 Replace cd with pushd,
currently NOT working for windows
2013-08-19 19:22:05 -07:00
Andy Stewart
e07e6aa601 Move hunk summary function to diff utility section. 2013-08-19 17:55:46 +02:00
Bailey Ling
bdaff53497 add documentation for GitGutterGetHunkSummary. 2013-08-19 15:41:26 +00:00
Bailey Ling
8951f68795 extract updating hunk summary into another function. 2013-08-19 15:26:24 +00:00
Bailey Ling
ab58e070cf introduce GitGutterGetHunkSummary for statusline integration. 2013-08-19 14:53:57 +00:00
Andy Stewart
6e1e1dfe09 Update signs in realtime.
Thanks to @ashb for the help with this.
2013-08-19 15:21:32 +02:00
Andy Stewart
c896c9c7f6 Merge branch 'issue-84'
* issue-84:
  Now working with shellslash
  Fixed escaping
  Escape shell commands on windows.
2013-08-19 10:34:13 +02:00
Wilson Y. Wong
e49faaea8f Now working with shellslash 2013-08-13 22:16:02 -07:00
Wilson Y. Wong
fa6c08b841 Fixed escaping 2013-08-13 21:32:00 -07:00
Andy Stewart
da7900a809 Escape shell commands on windows. 2013-08-07 10:02:18 +02:00
Andy Stewart
15113259bb Update when file modified externally. 2013-08-07 09:52:22 +02:00
Trevor Fitzgerald
ff031d022f Prevent error message from showing when s:dummy_sign_id is not set 2013-04-24 19:57:33 -04:00
Andy Stewart
935184bd18 Add default mappings. 2013-04-17 11:23:11 +02:00
Andy Stewart
1a13951fc5 Simplify tradeoff between accuracy and speed.
If the plugin slows down your Vim too much, you can have it run less
often by setting `g:gitgutter_eager = 0`.

This replaces the former options `g:gitgutter_on_bufenter` and
`g:gitgutter_on_focusgained`.
2013-04-17 10:43:45 +02:00
Andy Stewart
b63d3c6f27 Revert "Use correct filename in auto commands."
That commit prevented gitgutter correctly activating on its first run.

This reverts commit 25d428c390.
2013-04-15 10:24:37 +02:00
Andy Stewart
25d428c390 Use correct filename in auto commands.
This problem was revealed when using BufExplorer:

- Open vim with two files: `$ vim a.txt b.txt`
- Type `\\` to open BufExplorer.
- Press <enter> on `b.txt`.
- Vim shows `b.txt` as expected.
- Type `\\` to open BufExplorer.
- Press <enter> on `a.txt`.
- Expected: Vim shows `a.txt`.
  Actual Vim shows `a.txt`, `b.txt`, `a.txt`.

I.e. the first invocation was fine but all subsequent invocations
rapidly flicked through <new file>, <old file>, <new file>.
2013-04-12 13:17:05 +02:00
Andy Stewart
d4a1a60f39 Always prevent flicker.
Previously flicker was prevented only when the sign column was
always present.
2013-04-10 10:34:16 +02:00
Andy Stewart
fe1a76901c Always remove the sign column when disabling gitgutter.
Previously with `gitgutter_sign_column_always = 1` the sign column would
remain after calling `GitGutterDisable`.  Now the sign column is always
removed when disabling gutter.
2013-04-10 10:06:03 +02:00
cohama
9b45af6701 Prevent clearing highlight definitions when colorscheme changed 2013-04-07 21:15:58 +09:00
Andy Stewart
5c23cadf57 Allow plugin to bypass any alias for grep.
This is an opt-in configuration.
2013-04-05 11:23:11 +02:00
Andy Stewart
5bc25a8f11 Make grep optional instead of required.
When grep is available we use it for efficiency.  When it's unavailable,
we filter in Vimscript.
2013-04-05 11:08:19 +02:00
Andy Stewart
93288afef8 Update only visible buffers on FocusGained and TabEnter. 2013-04-02 11:37:37 +02:00
Justin M. Keyes
15dc21aca5 Check for grep
Fixes #72
2013-04-01 14:03:36 -04:00
Andy Stewart
989ad9b0fb Whitespace. 2013-03-28 09:39:12 +01:00
Andy Stewart
3243987028 Make signs optional (on by default). 2013-03-28 09:36:24 +01:00
Andy Stewart
60ce94c03b Better filename resolution. 2013-03-25 11:35:53 +01:00
Andy Stewart
948a0fb977 Allow configuration of extra arguments for git-diff. 2013-03-20 09:56:45 +01:00
Andy Stewart
985f5f87dd Remove unnecessary string concatenation. 2013-03-20 09:45:00 +01:00
Andy Stewart
357306f443 DRY configuration. 2013-03-20 09:42:08 +01:00
Andy Stewart
e04d719159 Customisable signs' symbols. 2013-03-20 09:29:00 +01:00
Andy Stewart
2a5ae179fc Speed up work done on FocusGained.
When vim-gitgutter is configured to update on `BufEnter`, which is the
default, we only need to update visible buffers on `FocusGained`.
Other buffers will be updated as and when the user enters them.
2013-03-19 20:08:54 +01:00
Andy Stewart
fd7fb6cd15 Fix bug where GitGutter wasn't called on buffer write.
This affected people with the default configuration but not those where
`BufEnter` was turned off.

This problem was introduced by the last commit.
2013-03-19 09:12:21 +01:00
Andy Stewart
7f1c104f9f Fix autocommands so GitGutter doesn't run twice on file read. 2013-03-18 16:09:40 +01:00
Andy Stewart
677dac451d Add opt-out configuration for BufEnter and FocusGained. 2013-03-15 10:53:31 +01:00
Andy Stewart
04be163a3e Fix bug for GitGutterEnable. 2013-03-15 10:20:43 +01:00
Andy Stewart
d40fd44904 Fix bug when calling GitGutterDisable immediately.
When opening Vim without editing any file, calling GitGutterDisable
would fail because `s:file` was undefined at that point.  The fix breaks
what encapsulation there is, but has the virtue of working.
2013-03-15 10:18:30 +01:00
Andy Stewart
f52625be83 Fix bug where vim-gitgutter tried to run for non-files. 2013-03-15 10:00:09 +01:00
Andy Stewart
c48829586e Update signs across all buffers on FocusGained. 2013-03-14 15:41:45 +01:00
Andy Stewart
3f107f97da Make always-showing-the-sign-column opt-in.
This is consistent with Vim's default behaviour.
2013-03-14 09:34:25 +01:00
Andy Stewart
15ee31acf4 Handle non-English locales. 2013-03-13 14:55:22 +01:00
Andy Stewart
fe2b4ec869 Place a dummy sign to keep sign column.
The sign column automatically appears when there is at least one sign
and disappears when there are none.  There's a small gap between
when vim-gitgutter removes its signs and adds new ones; during that gap
the sign column can flicker.

By adding a dummy sign before removing the real signs, we force the sign
column to remain.
2013-03-13 11:30:24 +01:00
Nick Andryshak
1f04008485 Improve fix to Windows gVim infinite shell loop. 2013-03-12 16:25:18 +01:00
Lewis Franklin
a09e085b51 Prevent infinite loop on Windows gVim. 2013-03-12 16:19:50 +01:00
Andy Stewart
6889f9918e Remove accidentally-committed maps. 2013-03-12 16:03:37 +01:00
Andy Stewart
64e9fac7df Enable prev/next hunk commands to take a count. 2013-03-12 15:57:57 +01:00
Andy Stewart
3979c4f7b6 Easier customisation. 2013-03-08 13:19:25 +01:00