Commit Graph

506 Commits

Author SHA1 Message Date
Andy Stewart
6076c96786 Only set up maps once per buffer. 2018-07-06 10:15:00 +01:00
Andy Stewart
f536a35d92 Whitespace. 2018-07-06 10:13:10 +01:00
Andy Stewart
23824041cd Force-update all buffers not just current after ShellCmdPost. 2018-07-06 10:12:30 +01:00
John Drouhard
b2be779ced Clear the tick on hidden buffers when gitgutter#all(1) is called.
This should allow hidden buffers to recalculate their diff when loaded
after a FocusGained event fires.
2018-07-05 15:25:58 +03:00
Andy Stewart
64663ab24f Handle buffers which no longer exist when callback executed.
Closes #509.
2018-07-04 08:43:58 +01:00
Martin Bukatovic
a986ab0547 Update FAQ in vim doc: refresh on file save 2018-06-01 21:31:52 +02:00
Martin Bukatovic
13e88015b4 Update FAQ in README: refresh on file save 2018-05-30 22:12:45 +02:00
Andy Stewart
c4301f9a10 Extract autocommand commands to a function for clarity. 2018-05-29 10:27:52 +01:00
Andy Stewart
f32eecc4fc Ensure inactive tabs are force-updated after FocusGained.
On FocusGained the current tab is force-updated.  If there are any other
tabs, we want to make sure they are also force-updated when the user
next switches to them.  To do this we set a flag which is read and
cleared on TabEnter.

See #525.
2018-05-29 10:22:03 +01:00
Andy Stewart
a7206c41fc Add test for files with leading dash. 2018-05-08 16:26:48 +01:00
John Kurkowski
f363799550 Support files with a leading -
Git treats anything past the `--` as filenames.
2018-05-05 23:05:31 -07:00
Daniel Hahler
22c3fc0bf5 gitgutter#utility#setbufvar: ensure bufnr is a number with setbufvar
Otherwise you might get "E93: More than one match for X" if there is a
buffer with "X" in its name besides buffer number X.
2018-05-02 08:06:48 -07:00
Andy Stewart
f167c3312b Make maps buffer-local. 2018-05-02 16:02:43 +01:00
Andy Stewart
ad25925f1e Add missing condition to determine whether running async.
See #505.
2018-04-19 13:03:45 +01:00
Andy Stewart
5481318fc1 Prevent infinite loop when running non-async on Windows.
Closes #505.
2018-04-11 09:56:43 +01:00
nagao_hiroki
3724e1c207 Add BOM support. 2018-03-26 22:12:46 +09:00
Andy Stewart
37bdd03d17 Do not deactivate gitgutter when &diff is set.
In #303 there was a request to deactivate gitgutter when &diff is set,
although no reason was given initially.  Then it was reported that
gitgutter showed signs, in the wrong place, during Fugitive's Gdiff.

However I cannot reproduce signs showing in Gdiff's index buffer.  And
the signs in the working tree buffer are correct.

Furthermore the commit which deactivated gitgutter (85f6e136) had the
side-effect of breaking `:redir` and clearing Vim's startup message
(see #500).

Therefore since that change had no benefit, and a couple of drawbacks,
it makes sense to undo it.

Closes #500.
2018-03-16 18:49:22 +00:00
Andy Stewart
be14ed7943 Add sign/s to unplace profile. 2018-03-15 12:08:31 +00:00
Andy Stewart
c071a8f273 Add script for timing sign-unplace. 2018-03-15 11:09:38 +00:00
Andy Stewart
72226496b3 Add test for encoding conversion. 2018-03-14 14:44:33 +00:00
Andy Stewart
813723a195 Whitespace. 2018-03-14 14:40:14 +00:00
Andy Stewart
efd373d86d Move look-up out of loop. 2018-03-14 14:40:06 +00:00
Bakudankun
3b2461b2fb Fix wrong signs when &encoding and &fileencoding differ 2018-03-14 14:34:24 +00:00
Andy Stewart
2f736d58b4 Backward compatibility for nvim-0.1.7.
NeoVim 0.1.7 does not support the `function()` function accepting an
optional argument list.

Fixes #496.
2018-03-14 11:43:36 +00:00
Andy Stewart
380e7935b7 Make test flag more specific. 2018-03-08 11:47:08 +00:00
Chayoung You
538e07882a Handle files in different drive on Windows 2018-03-06 03:07:42 -08:00
Andy Stewart
b87aacbbfe Do not treat win32unix as Windows.
This reverts 16568f4815 which was, I believe now, mistaken.

See #471.
2018-03-06 10:55:47 +00:00
Plamen Kolev
983193456f Ignore the arguments when testing the grep executable 2018-03-05 15:54:47 +00:00
Andy Stewart
5db4a3a2a5 Make robust the replacement of temp file paths with actual paths.
The previous implementation meant the temp file paths were treated as
regular expressions, which was vulnerable to problems with backslashes
etc.

See #494.
2018-03-02 12:44:49 +00:00
Andy Stewart
fa85bd41d9 Pass filepath into s:fix_file_references() to make function pure. 2018-03-02 11:41:48 +00:00
Andy Stewart
05e538e553 Remove irrelevant comment. 2018-03-01 10:24:08 +00:00
Daniel Hahler
85d762fff6 Improve warning message for max-signs-exceeded 2018-03-01 10:11:03 +00:00
Daniel Hahler
41b951e64e Fix gitgutter#utility#warn_once: use echom
This a) logs the message to be seen in `:mess` and b) avoids the
hit-ENTER prompt (which is likely caused by the message not being
logged and Vim deciding that you need to see it then).

So a) fixes b).
2018-03-01 10:11:03 +00:00
Daniel Hahler
2fe748b48f plugin/gitgutter.vim: use command! to allow for reloading 2018-03-01 10:06:56 +00:00
Andy Stewart
0055e97bac Use '-c "core.safecrlf=false"' to avoid unhelpful line ending warnings.
See #486.
2018-02-28 19:17:31 +00:00
Andy Stewart
33c4c4a685 Enable update on FocusGained for gVim.
This was prevented to avoid an infinite loop on gVim (see #42).
However that was 5 years ago and this no longer seems to be a problem
(even running synchronously).
2018-02-28 16:56:26 +00:00
Andy Stewart
293b633d79 Add --no-pager to git-show and git-diff.
I needed these to get output from the commands on Windows.
2018-02-28 16:45:39 +00:00
Andy Stewart
c39a5c240a Add g:gitgutter_terminal_reports_focus to enable FocusGained workaround.
See #490.
2018-02-28 15:09:36 +00:00
Andy Stewart
4a66a09658 Document dependency on focus events. 2018-02-28 11:43:00 +00:00
Andy Stewart
2a3ab77f10 Access tab variable directly instead of via {g,s}ettabbar().
Fewer function calls and better backward compatibility.
2018-02-27 11:37:38 +00:00
Andy Stewart
e512d3a6fc Make the process_hunks() function public.
This is so other plugins, e.g. vim-signature, may use it.

Closes #489.
2018-02-26 08:58:27 +00:00
Andy Stewart
b27ee4d602 Rename variable for clarity. 2018-02-22 16:23:17 +00:00
Andy Stewart
816fc98ff2 Swap order of if/else so it reads better. 2018-02-22 11:09:05 +00:00
Andy Stewart
61a5e0143e Do not warn user when default grep cannot be found.
This restores the behaviour that was accidentally changed in 5bfe5b9.
2018-02-22 11:06:34 +00:00
Andy Stewart
e9aee00190 Switch off diff.mnemonicPrefix in tests.
Follows on c325a8b.
2018-02-22 11:04:10 +00:00
Andy Stewart
c3bad229db Use built-in uniq() when available. 2018-02-22 10:32:21 +00:00
Andy Stewart
87097d8923 Fix bugs in s:uniq().
I can't believe I got this wrong.

Fixes #485.
2018-02-22 10:17:28 +00:00
Daniel Hahler
c325a8b6d3 s:fix_file_references: handle diff.mnemonicPrefix
An alternative would be to run `git` with no user config always, i.e.
setting `GIT_CONFIG_NOSYSTEM` and `HOME=/dev/null` (different for
Windows then) in its environment.  Maybe there's an easier way / single
option for this..
2018-02-22 09:49:31 +00:00
Andy Stewart
9325986457 Remove deprecated command GitGutterRevertHunk. 2018-02-21 12:23:02 +00:00
Andy Stewart
8f6bbc9855 Extract uniq function. 2018-02-21 12:06:42 +00:00