Commit Graph

417 Commits

Author SHA1 Message Date
Andy Stewart
932ffaca09 Ensure we write correct buffer.
Fixes #454.
2018-01-29 15:30:25 +00:00
Sudo Nice
1e60667322 Open folds on hunk jumping 2017-11-01 11:58:34 +00:00
Andy Stewart
579f0a5006 Make async callbacks backward compatible for nvim < 0.2.0 2017-10-23 10:08:43 +01:00
Andy Stewart
54209a0199 Simplify async implementation. 2017-10-16 09:22:55 +01:00
Andy Stewart
438bff6a63 Whitespace. 2017-10-16 09:22:55 +01:00
Lucas Hoffmann
f2ff2321cd Fix small typo in highlight group name 2017-10-16 08:37:47 +02:00
Andy Stewart
dc73a81bfe Deprecate g:gitgutter_sign_column_always for &signcolumn. 2017-08-02 15:47:04 +01:00
Andy Stewart
c92f61acdc Ensure that all buffers are processed at startup.
When opening vim with multiple files, e.g. via `vim -o file1 file2`, Vim
fires a `BufEnter` event for each file.  However the effective buffer
number (`<abuf>`) is always 1, instead of being each buffer's number in
turn, so we end up processing the first buffer n times instead of each
of n buffers once.

This commit is a brute force workaround to ensure all buffers are
processed if there is more than one.

Closes #428.
2017-07-26 09:36:29 +01:00
Andy Stewart
dcac1f74ee Add a note about CDPATH.
See #382, #423.
2017-06-08 09:10:48 +01:00
Tyler Brazier
b803a28f47 External commands (:!) update the gutter
Fixes #418
2017-04-28 20:13:09 -05:00
Andy Stewart
fd4fa5bed7 When switching tabs wait for BufEnter before running.
This ensures we process the correct buffers.

See #413.
2017-04-25 14:33:10 +01:00
Andy Stewart
f16cf539a2 Turn off grep colour when GREP_OPTIONS switches it on.
Closes #415.
2017-04-20 12:37:52 +01:00
Andy Stewart
9ecce5a269 Do not use --color=never flag for grep.
See #410.
2017-04-03 13:30:23 +01:00
Andy Stewart
092369c19c Use plain grep instead of extended grep.
See #410.
2017-04-03 13:23:50 +01:00
Andy Stewart
1c034be0d3 Store buffer local variables in a single dictionary.
This reduces the footprint in the buffer variable namespace to a single
key.
2017-02-22 11:28:25 +00:00
Andy Stewart
14dd430533 DRY buffer local namespace prefix. 2017-02-22 10:51:12 +00:00
Andy Stewart
1bbf892eba Use custom functions for plugin buffer-local variables. 2017-02-22 10:43:52 +00:00
Andy Stewart
562e6043d3 Explain how to cycle through hunks in all buffers. 2017-02-22 10:03:04 +00:00
Andy Stewart
8576f00548 Make hunks buffer-local. 2017-02-21 16:40:18 +00:00
Andy Stewart
80375e6b8b Ensure git uses source and destination prefixes when staging.
See #313.
2017-02-20 13:51:36 +00:00
Andy Stewart
5d1a0bfa1b Add licence file. 2017-02-06 10:19:09 +00:00
Scott Sanders
77aa7ea225 Negate the shell_error value during return 2017-01-09 09:43:04 -05:00
Scott Sanders
33cceff0fc Use call to execute this shell command 2017-01-09 09:42:44 -05:00
Scott Sanders
ce8b5a4086 Detect git version >= 1.7.2 without a messy regex 2016-12-30 16:41:38 -05:00
Andy Stewart
7b81a8a226 Specify job command as a string on Windows.
Specifying the command as a list seems to be less reliable.

See #377.
2016-12-23 11:20:17 +00:00
Andy Stewart
9639f28037 Prevent undo-hunk scrolling window.
The previous implementation assumed that CTRL-Y and CTRL-E could scroll
by negative counts, i.e. in the opposite direction.  It turns out they
cannot: they treat negative counts as positive ones and always scroll in
the same direction.

This meant that undoing a hunk in the top half of the screen caused the
screen to scroll.

Closes #394.
2016-12-16 10:36:30 +00:00
James McCoy
e231bbc24a Declare nvim's callback as a dict function
neovim/neovim#5529 merged support for Vim's partial functions, which
made nvim more strict about dictionary functions.  This means the
implicit self variable isn't available unless a function is annoted as a
dict function or defined as part of a dictionary.

Closes #392
2016-12-12 22:30:30 -05:00
Alfredo Canziani
eaea1c5bba Fix help tag. 2016-11-29 16:22:19 +00:00
Alfredo Canziani
eb896b3598 Improve documentation
Add `:pclose` and `CTRL-W CTRL-Z` commands to `:GitGutterPreviewHunk` description.
2016-11-27 12:10:00 -05:00
Thomas Larrieu
1742a8f568 Replace "normal" command with "normal!"
We do not want to use user defined mappings
2016-10-27 21:35:39 +02:00
Andy Stewart
ee481585d7 Modernise tests.
Use Vim's built-in assert_*() functions and vim-contest test runner.
2016-10-27 12:15:43 +02:00
__
64a445bb53 Vim: explicitly check for job support. 2016-10-20 17:01:11 +01:00
Andy Stewart
0d455a7af7 Only restore shell if previously saved. 2016-10-19 14:17:03 +01:00
Andy Stewart
a693c0d326 Ensure nested calls do not overwrite value of original shell.
See #379.
2016-10-19 10:00:11 +01:00
Andy Stewart
b1734a3916 Remove unnecessary space concatenation. 2016-10-18 10:14:21 +01:00
Andy Stewart
e113f07d0b Avoid autocmd side-effects when jumping to/from preview window.
Fixes #379.
2016-10-18 10:12:30 +01:00
Andy Stewart
297678a08d Ensure BufWritePost,FileChangedShellPost always process buffer.
Before this change the TabEnter/BufEnter logic was intertwined with
the logic for BufWritePost,FileChangedShellPost.

Separating the concerns fixes a minor bug where a TabEnter-BufEnter
combination led to the plugin not updating the diff the first time the
buffer was written.
2016-10-11 10:02:21 +01:00
Andy Stewart
fa25cbb7d7 Check whether gitgutter is active in async callbacks.
Closes #375.
2016-10-10 12:52:28 +01:00
Andy Stewart
55b556f7a2 Dedup buffer lists to avoid unnecessary work. 2016-10-10 12:52:05 +01:00
Andy Stewart
68f6fa3453 Whitespace. 2016-10-10 12:42:07 +01:00
Andy Stewart
4f9c5b0f3e Use 'sh' as shell instead of configurable '/bin/sh'.
sh isn't always at /bin/sh, e.g. on Android or Termux, but it is always
on the path.

See #360.
2016-09-30 10:28:29 +01:00
Andy Stewart
402257f920 Enable configuration of path to sh (default /bin/sh).
See #360.
2016-09-16 14:22:13 +01:00
Andy Stewart
373ad7337b Handle buffers which have since been closed in async callbacks. 2016-09-13 16:11:42 +01:00
Billy
efa1ead770 Typo fix. 2016-09-09 09:05:41 +01:00
Andy Stewart
43e7c1f542 Set &shellredir when changing shell.
See #365.
2016-09-06 10:36:09 +01:00
Filip Szymański
26c6b549f2 Use "ch_info()" to get channel id 2016-07-12 19:05:32 +02:00
Andy Stewart
b5f23e9867 Use known shell for hunk staging, previewing, undoing.
Forgot to do this in 377c71d.

Closes #352.
2016-06-27 10:55:26 +01:00
Luke Farrar
c8fa0b3349 Move -r to start of args for non-GNU folk. 2016-06-21 10:28:56 +01:00
Luke Farrar
88e26c0fdf Fix manual install commands. 2016-06-21 10:28:56 +01:00
Andy Stewart
d19e86d249 Update FAQ in README. 2016-06-21 09:57:39 +01:00