Commit Graph

447 Commits

Author SHA1 Message Date
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
Andy Stewart
2d32a2965a Improve hunk previewing.
- Treat &previewheight as a maximum height.
- Make preview window shrink to fit the hunk.
- Resize preview window each time.
- Make preview window readonly and nomodifiable.

Based on code by @somini.  Thanks!

See #451.
2018-02-12 16:32:43 +00:00
Andy Stewart
a8af1853bd Remove long-standing deprecation warning. 2018-02-12 16:21:10 +00:00
Andy Stewart
d137753182 Handle &write option being off (e.g. vim -m FILE).
See #407.
2018-02-12 16:19:01 +00:00
Andy Stewart
8da5b64868 Avoid autocmds when switching buffers to write temp file. 2018-02-12 16:02:03 +00:00
Andy Stewart
3a052e4777 More idiomatic execute. 2018-02-12 15:52:34 +00:00
Andy Stewart
1452900ffd Check buffer is active before init. 2018-02-12 15:34:49 +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
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