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
Daniel Hahler
d78184e646
Use processed-dict, uniq() might not be available
2018-02-21 11:54:15 +00:00
Daniel Hahler
6c2def1075
Use sort+uniq with tabpagebuflist to remove duplicates
2018-02-21 11:54:15 +00:00
Daniel Hahler
4931dd1a82
Conditionally define s:vimdiff
...
This optimizes it a bit since the `exists()` is not called always.
2018-02-21 11:46:36 +00:00
Daniel Hahler
18f6d0ffe1
gitgutter#utility#setbufvar: skip unnecessary setbufvar
...
An existing dict gets returned by reference, so changing it does not
need a call to `setbufvar` afterwards.
2018-02-21 11:39:42 +00:00
Daniel Hahler
10254400c3
doc: fix example for g:gitgutter_diff_args
2018-02-21 11:35:53 +00:00
Andy Stewart
798abe53b3
Extract helper for triggering gitgutter.
2018-02-21 11:33:44 +00:00
Andy Stewart
35c92dbd50
Add test for user autocmd.
2018-02-21 11:31:48 +00:00
Daniel Hahler
a046b5ace1
Improve GitGutter User autocommand: context/unsilent
...
This provides `g:gitgutter_hook_context` during the hook's execution and
removes the `:silent`, but uses `exists()` instead.
The bufnr might be necessary to know in the User autocommand, e.g. to
clear some cache.
Not using`:silent` is good practice in general to not hide (wanted)
output and errors etc.
2018-02-21 11:23:02 +00:00
Andy Stewart
4692457ae2
Document how to disable realtime updates.
2018-02-19 14:31:59 +00:00
Andy Stewart
38a7789be9
Finish when pre-requisites not fulfilled.
2018-02-19 14:04:49 +00:00
Andy Stewart
d86ac1353f
Avoid race conditions when processing multiple buffers asynchronously.
...
Fixes #472 .
2018-02-19 12:56:22 +00:00
Andy Stewart
457f35e444
Ensure a re-activated buffer runs a diff.
...
See #303 .
2018-02-19 10:59:39 +00:00
Andy Stewart
ef94b195ab
Add tests for text objects.
2018-02-19 10:51:21 +00:00
Patryk Czachurski
314e64673b
Fixed call to current_hunk in hunk text object
2018-02-19 10:14:34 +00:00
Andy Stewart
790ffa476a
Simplify reading of buffer variable.
2018-02-17 09:19:28 +00:00
Andy Stewart
16568f4815
Add win32unix to OS check.
2018-02-16 15:40:02 +00:00
Andy Stewart
13361da09e
Only use overbar sign when UI supports it.
...
Thanks @h3xx.
Closes #471 .
2018-02-16 13:06:23 +00:00
Andy Stewart
7e3f41cdec
Update docs.
2018-02-16 12:54:04 +00:00
Andy Stewart
ec6e1e484b
Update docs with changed grep option.
...
Thanks @ErichDonGubler.
Closes #467 .
2018-02-16 10:52:24 +00:00
Andy Stewart
213bd34bdf
Mention hunk text object in introduction.
2018-02-15 17:17:23 +00:00
Andy Stewart
d586e4398e
Add note about updatetime to troubleshooting section.
2018-02-15 17:16:59 +00:00
Andy Stewart
72b789ea8f
Clarify that unstaging staged hunks is out of scope.
2018-02-15 17:16:16 +00:00
Andy Stewart
44373fd1dc
Add issue template.
2018-02-15 14:55:37 +00:00
Andy Stewart
0c94dd0235
Handle UNC paths.
...
Fixes #328 .
2018-02-15 14:52:10 +00:00
Andy Stewart
85f6e136bd
Turn off gitgutter for any buffer with a vimdiff window.
...
Closes #303 .
2018-02-14 11:10:59 +00:00
Andy Stewart
4e911819be
Write buffer using writefile() instead of :write.
...
This is to avoid side effects caused by switching to the buffer to be
written and back again.
It also means that the plugin can process any buffer without having to
make it the current buffer.
Using the lower level writefile() function means we have to deal with
line endings. It might also mean we have to deal with (file) encodings
but I hope not...
See #463 , #466 .
2018-02-13 10:22:36 +00:00
Andy Stewart
850e947509
Add backward compatibility for lambda.
...
Lambdas were introduced in Vim 7.4.2044.
2018-02-13 10:02:54 +00:00
Andy Stewart
933af37935
Replace v:t_string with backward-compatible equivalent.
...
v:t_string was introduced in Vim 7.4.2071.
Closes #464 .
2018-02-13 09:37:45 +00:00
Andy Stewart
9ed38f00ee
Merge branch 'master' of ssh://github.com/airblade/vim-gitgutter
...
* 'master' of ssh://github.com/airblade/vim-gitgutter:
Pass bufnr into warn_once function.
2018-02-13 09:33:17 +00:00
Andy Stewart
7f14cd142c
Pass bufnr into warn_once function.
...
Fixes #465 .
2018-02-13 09:32:38 +00:00
Andy Stewart
8f2e2a226a
Pass bufnr into warn_once function.
2018-02-13 09:32:22 +00:00
Andy Stewart
8a7d00590b
Restore support for vim-repeat in hunk ops.
2018-02-12 16:42:20 +00:00