Commit Graph

195 Commits

Author SHA1 Message Date
Andy Stewart
fef14f1d49 Ignore non-gitgutter signs by default on Neovim >= 0.4.0
See #627.
2019-08-12 10:03:59 +01:00
Dan Aloni
9bf988bd1d Add g:gitgutter_sign_allow_clobber to control clobbering.
I.e. how gitgutter handles non-gitgutter signs.

See #565, #627.

Co-authored-by: Andy Stewart <boss@airbladesoftware.com>
2019-08-10 07:29:15 +01:00
delphinus
fc4f9d2039 Add commands to control numhl highlights 2019-08-08 16:40:35 +01:00
delphinus
78876150ae Add logic for sign with numhl 2019-08-08 16:40:35 +01:00
homestar
8985017094 Add g:gitgutter_preview_win_location option 2019-08-08 16:31:44 +01:00
Andy Stewart
c75c83df53 Ensure maps set on all buffers for vim -o/-O.
Fixes #634.
2019-07-26 10:27:58 +01:00
Andy Stewart
07b60b584e Update signs when file renamed via :saveas
Fixes #551.
2019-06-04 12:37:59 +01:00
Andy Stewart
064a3d6b10 Move #init_buffer() into #process_buffer(). 2019-05-29 14:36:53 +01:00
Andy Stewart
7eeea63e62 Remove debugging statement. 2019-03-11 11:29:59 +00:00
Daniel Hahler
3d313838db Only handle FocusGained after FocusLost 2019-03-11 11:29:11 +00:00
Andy Stewart
5c8efd3625 Fix updating of signs when leaving nvim terminal buffer.
Closes #587.
2019-03-04 08:52:54 +00:00
Andy Stewart
ac787afa02 Add GitGutterFold command.
Closes #286, #571.
2019-01-14 11:48:24 +00:00
Andy Stewart
8d7a71ddd6 Update signs when leaving Neovim terminal.
Closes #570.
2019-01-08 16:22:36 +00:00
Andy Stewart
2dce8e032b Add commands to enable/disable/toggle GitGutter per buffer. 2019-01-08 12:47:10 +00:00
Andy Stewart
6f8acdcea1 Whitespace. 2018-10-18 09:48:57 +01:00
Andy Stewart
89c34f74cb Display unambiguous sign when hunks overlap.
See #556.
2018-10-18 09:45:55 +01:00
John Nguyen
50a7062909 Trigger refresh on VimResume event
VimResume is neovim event that is triggered when process is resumed to
foreground.
2018-08-14 22:02:33 -07:00
Andy Stewart
d2d2da11c5 Add g:gitgutter_git_args for args to git when running git-diff.
See #541, #546.
2018-07-31 14:28:36 +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
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
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
Plamen Kolev
983193456f Ignore the arguments when testing the grep executable 2018-03-05 15:54:47 +00:00
Daniel Hahler
2fe748b48f plugin/gitgutter.vim: use command! to allow for reloading 2018-03-01 10:06:56 +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
c39a5c240a Add g:gitgutter_terminal_reports_focus to enable FocusGained workaround.
See #490.
2018-02-28 15:09:36 +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
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
9325986457 Remove deprecated command GitGutterRevertHunk. 2018-02-21 12:23:02 +00:00
Andy Stewart
38a7789be9 Finish when pre-requisites not fulfilled. 2018-02-19 14:04:49 +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
a8af1853bd Remove long-standing deprecation warning. 2018-02-12 16:21:10 +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
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
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
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
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
867e013a62 Improve guard for missing-git warning again. 2016-05-16 16:29:40 +01:00
Andy Stewart
55d8247848 Fix guard for missing-git warning. 2016-05-16 13:50:27 +01:00
Andy Stewart
f5a5234f22 Allow configuration of git executable. 2016-05-16 13:47:14 +01:00
Andy Stewart
9db8f638db Make hunk summary window-aware.
Closes #331.
2016-05-16 12:21:06 +01:00