Commit Graph

29 Commits

Author SHA1 Message Date
Andy Stewart
4477570033 Keep references to pending jobs to avoid premature deletion
This only applies to Vim.

See #735.
2020-10-30 11:52:56 +00:00
Daniel Hahler
7201afe8d1 s:on_stderr_nvim: do not call err handler for [''] 2019-03-08 13:47:54 +00:00
Andy Stewart
208b439585 Vim: remove unreliable way of preventing close callback for unsuccessful job.
Until this commit the err callback closed the channel to prevent the close
callback from being invoked, because the close callback invoked the out
handler (which we don't want when the job was unsuccessful).

This mostly worked but if closing the channel took too long, which it
seemed it could when dealing with large files, the close callback could
be called in the meantime.

This commit removes the unreliable code.  The parent commit ensured that
the close callback only calls the out handler when the job succeeded, so
we no longer need to try to prevent the close callback from being
called.
2018-11-17 17:22:53 +00:00
Andy Stewart
da91d44889 Vim: only invoke async out handler when job succeeded.
This makes the plugin use Vim the same was as Neovim in terms of
invoking callback handlers.
2018-11-17 17:13:13 +00:00
Andy Stewart
5bfe5b9209 Big refactor.
- Hunk stage/undo/preview no longer saves the buffer.
- Hunk undo no longer makes locations go out of sync.
- Grep can be opted out of (grep output with ansi escapes is number one cause
  of issues).
- Replaced g:gitgutter_grep_command with g:gitgutter_grep.
- Always runs git-diff the same way instead of in two possible ways.
- Separated detection of git tracking from diffing.
- Simplified path handling.
- Removed support for xolox shell: Windows taskbar does not flash with async
  jobs.
- Removed g:gitgutter_{eager,realtime}.
- Simplified implementation generally.
2018-02-12 14:25:11 +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
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
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
__
64a445bb53 Vim: explicitly check for job support. 2016-10-20 17:01:11 +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
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
Filip Szymański
26c6b549f2 Use "ch_info()" to get channel id 2016-07-12 19:05:32 +02:00
Andy Stewart
cfbca4455c Enable async diffs in gVim 7.4.1850+. 2016-06-09 10:30:48 +01:00
Xavier Guérin
377c71d982 Use /bin/sh as default shell.
- /bin/bash is not part of OpenBSD.
- We need only a POSIX shell, not bash specifically.

Closes #340.
2016-05-20 11:13:45 +01:00
Andy Stewart
1937f06498 Avoid potential shell (un)quoting problems in NeoVim.
See neovim/neovim#4746 for a discussion.
2016-05-16 10:36:27 +01:00
Andy Stewart
053581db5c MacVim GUI 7.4.1832+ supports async diffs. 2016-05-16 10:10:11 +01:00
Andy Stewart
cae4f72aa1 Abort functions at first error. 2016-05-13 14:14:41 +01:00
Andy Stewart
882073f4b5 Restrict async diffing in Vim to terminal Vim.
MacVim in GUI mode and gVim don't process the callbacks reliably (or at
all) yet.
2016-05-12 10:22:43 +01:00
Andy Stewart
169e08a718 Apply signs to correct buffer when using Vim async. 2016-05-10 15:33:44 +01:00
Andy Stewart
0e490ec830 Require Vim 7.4.1826 for async Vim. 2016-05-09 16:57:43 +01:00
Andy Stewart
72d100517a Update vim callback handlers in light of vim change.
Vim 7.4.1810 stopped sending DETACH to the out_cb handler to mark the
end of the job's stdout.  Instead we add a close_cb handler which does
what the out_cb handler used to do upon receiving DETACH.
2016-05-09 16:54:34 +01:00
Tommy Allen
a4e75dd074 Apply signs to correct buffer when using Neovim async 2016-05-09 12:16:09 +01:00
Andy Stewart
db6a253d68 Disable async for vim pending vim segfault fix.
References:

- #332
- https://groups.google.com/d/topic/vim_dev/n0jeRog4DI0/discussion
2016-05-05 10:28:16 +01:00
Andy Stewart
3ffd67d905 Extract stringify function. 2016-04-29 10:02:15 +01:00
Andy Stewart
e607a997ce Asynchronous diffs in Vim. 2016-04-29 09:50:57 +01:00