Commit Graph

734 Commits

Author SHA1 Message Date
obcat
0cbe0f392d Prevent hunk preview using preview window from changing alternate file 2021-02-06 11:37:12 +09:00
Andy Stewart
ff9d134f0c Add help file modeline 2021-01-26 11:12:56 +00:00
acelya
512e2999ed Force cmd.exe to be used by system() instead of pwsh or powershell on Windows 2020-12-11 16:13:05 +00:00
Andy Stewart
dfe55e2b92 Recreate temp directory if it gets deleted
Vim does not check the existence of its temp directory when generating
file names with tempname().  Therefore if, for some reason, the temp
directory gets deleted, Vim will continue to generate paths for file
names inside the directory.  Writes to these file paths will fail
(E482).

See #746, #433, #190, #147.
2020-11-25 12:42:00 +00:00
Andy Stewart
81963946ed Reuse tempfile base names
This reverts "Use fresh temp files for every diff" [1].  At the time I
did not realise that Vim never checks the existence of its temp
directory after creating it at startup; I thought that each call to
tempname() generated a fresh file on disk.  In fact tempname() simply
generates a string path.

Therefore there is no point calling tempname() for every diff.  Doing so
only serves to generate more files in the temp directory than necessary.

[1] dab840b153
2020-11-25 12:33:55 +00:00
Andy Stewart
bf813bb990 Add some troubleshooting steps 2020-11-24 09:44:51 +00:00
Andy Stewart
f614693b2a Replace custom function with built-in get() function 2020-11-21 11:19:06 +00:00
Andy Stewart
a1f9f1f728 Suggest a command instead of a map for opening quickfix
See #676, #749.
2020-11-20 10:46:03 +00:00
Andy Stewart
15b19020b4 Document how to open quickfix list after :GitGutterQuickFix
See #676, #749.
2020-11-20 10:00:41 +00:00
obcat
987a33355e Show message like "Hunk 4 of 11" after hunk jumping 2020-11-05 16:43:52 +00:00
Andy Stewart
696a6ed389 Ensure that buffer is processed soon after startup
Fixes #738.
2020-10-30 12:27:48 +00:00
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
Andy Stewart
e480eb2b63 Use g:gitgutter_grep instead of grep in debug command
Closes #741.
2020-10-27 16:40:39 +00:00
Andy Stewart
ea79bc01c2 Skip processing on BufEnter while vim is starting
This is to keep vim's startup as fast as possible.

Closes #734.
2020-09-11 11:44:35 +01:00
Andy Stewart
d9dd9c8b74 Fix missing variable prefix 2020-09-08 09:43:53 +01:00
Andy Stewart
94ee004087 Do not output shell related options in #debug() 2020-09-07 13:21:02 +01:00
Hexin
098b9c82e9 Add help tag to Vim help file 2020-08-31 10:17:45 +01:00
Andy Stewart
8005f71aab Avoid floating preview window immediately closing itself
Fixes #728.
2020-08-07 12:06:17 +01:00
Andy Stewart
82f3ea6a40 Fix typo in highlight group name
See #727.
2020-08-05 12:19:08 +01:00
Andy Stewart
642cef87f4 Treat cleared highlight groups as not set
Setting a colorscheme often clears all existing highlight groups.  When
the plugin subsequently sets up its colours, it sees that the GitGutter*
groups exist and leaves them alone - even though they have been cleared.

This change means cleared groups do get their colours set up again.

See #727.
2020-08-05 12:15:27 +01:00
Andy Stewart
62ff20f979 Return early when pre-condition not met 2020-07-28 10:16:47 +01:00
Andy Stewart
63941de9f9 Distinguish no hunks at all from no further hunks
Closes #709.
2020-07-28 10:12:48 +01:00
shinjiro-sugita
81d209ffec update(doc/gitgutter.txt): Document sign removed above and below 2020-07-28 10:01:32 +01:00
shinjiro-sugita
1033745403 fix(plugin/gitgutter.vim): Avoid using double-byte characters 2020-07-28 10:01:32 +01:00
Andy Stewart
25942fbf9a Document sign removed above and below
Closes #723.
2020-07-27 15:10:24 +01:00
Andy Stewart
64018119fb Change default sign for removed above and below
Closes #724.
2020-07-27 15:07:45 +01:00
Andy Stewart
c27bfab8c5 Make quickfix paths relative to current working directory
Closes #715.
2020-06-25 16:30:10 +01:00
Andy Stewart
51a03d4ae0 Add option for <Esc> to close non-floating preview window
Closes #718.
2020-06-23 15:18:25 +01:00
Andy Stewart
faf2581f00 Remove duplicate args in GitGutterQuickFix 2020-06-22 10:25:46 +01:00
Andy Stewart
e2c2edcd52 Remove duplicate args introduced in dc3c0dcd 2020-06-22 10:24:05 +01:00
Andy Stewart
d82f272142 Remove obsolete profiling script
Placing and unplacing signs is fast in modern Vims / NeoVims.
2020-06-20 16:44:43 +01:00
Andy Stewart
97a24e903a Reset any existing preview window
When previewing a hunk we re-use any existing preview window.  However
we need to reset it for our purposes in case it was used in an
incompatible way before.

See #713.
2020-06-18 09:38:43 +01:00
Andy Stewart
e31e9bb35f Avoid E315 when populating Neovim floating preview window
Fixes #711.
2020-06-10 09:13:35 +01:00
Andy Stewart
9784226ba7 Account for wrapping when resizing preview window
Fixes #708.
2020-05-29 10:46:42 +01:00
Andy Stewart
b356cc9a7d Set background colour on GitGutterChangeDelete 2020-05-01 16:13:53 +01:00
Andy Stewart
4802c04f1d Remove obsolescence warning about sign column 2020-05-01 12:03:16 +01:00
Andy Stewart
76d1cf609d Do not set background on existing GitGutter* highlights unless requested
If GitGutter* highlight groups already exist, they were declared
deliberately (either by the colorscheme maintainer or the user).  So do
not adjust them.

However if you would like to make the signs' backgrounds match the sign
column, you can do this:

    let g:gitgutter_set_sign_backgrounds = 1
2020-04-30 19:43:02 +01:00
Andy Stewart
0da302c28a Do not adjust SignColumn highlight
This was introduced in 07d7c9d4 because many colorschemes at the time
had ugly sign columns, and people kept asking how to deal with it.

These days there are many more plugins which use the sign column and
consequently more colorschemes pay attention to the SignColumn highlight
group.

Therefore it no longer makes sense for vim-gitgutter to adjust the
sign column's appearance.

To restore the previous behaviour, add this to your vimrc:

    highlight! link SignColumn LineNr

See #696.
2020-04-30 19:41:09 +01:00
Andy Stewart
f458f43cf2 Fall back to sensible sign colours
Do this when there are no existing GitGutter* highlight groups and the
Diff* highlight groups have the same foreground colours.
2020-04-28 17:50:54 +01:00
Andy Stewart
67d5dc11d6 Bail early if git cannot be found
There is no point trying to run without git.
2020-04-27 14:12:33 +01:00
Andy Stewart
a194e9da01 When git cannot be found only warn if plugin enabled
This enables the plugin to be loaded on systems without git, without
emitting any warnings.

See #702.
2020-04-27 14:09:56 +01:00
Andy Stewart
011fca3f02 Only use '/d' flag for 'cd' in DOS shell
Closes #678.
2020-04-27 10:38:35 +01:00
Andy Stewart
ea14301cb4 Default to not limiting number of signs on newer Vims
The limit on the maximum number of signs was introduced when Vim's sign
drawing code was much slower than it is now.

See #681.
2020-04-27 10:09:22 +01:00
Andy Stewart
70855aa93d Enable turning off limit on maximum number of signs
Setting the variable to a known value (-1) is neater than an arbitrary
high number.

See #681.
2020-04-27 10:02:03 +01:00
Andy Stewart
f411d8680e Do not override existing diff* highlight groups
See #701.
2020-04-25 20:00:24 +01:00
Andy Stewart
3fb9a59a06 Handle existing GitGutter* highlight groups which are links
Fixes #701.
2020-04-25 13:51:29 +01:00
Andy Stewart
8a380e2f90 Ensure good diff syntax highlighting in preview
Specifically, make it match the signs' foreground colours; and clear the
backgrounds so the GitGutter{Add,Delete}IntraLine highlights' "reverse"
colours work properly.
2020-04-25 13:33:05 +01:00
Andy Stewart
3cb5cbfd18 Revert preview window diff colours 2020-04-25 11:38:46 +01:00
Andy Stewart
f34ce3aa6b Set default diff colours for the preview window
Some colourschemes forget this.
2020-04-25 11:27:58 +01:00
Andy Stewart
8db2fc5da0 Set correct background on existing GitGutter* highlight groups
Previously if the user or the colourscheme had already defined
GitGutter* highlight groups, the plugin would leave their backgrounds
alone.  This pushed the responsibility for figuring out and specifying
the correct backgrounds onto the user or colourscheme maintainer.

With this change the plugin now sets the correct background on existing
GitGutter* highlight groups.

Also, the documentation was simplified so it is clearer how to set your
own colours for the signs.
2020-04-25 11:17:34 +01:00