Commit Graph

849 Commits

Author SHA1 Message Date
Vincent Cordobes
602a5ba19e Clean up warning messages 2021-04-22 12:03:06 +01:00
Andy Stewart
9756e95bd5 Fix resizing of existing non-floating hunk preview window
This bug was introduced by 9784226 in #708.  It had the effect of not
allowing an existing hunk preview window to increase in size for a
larger hunk (up to 'previewheight').

See #775.
2021-04-13 15:18:27 +01:00
Andy Stewart
24cc477895 Avoid cursor in unexpected window after Esc in preview
Thanks @andymass for the patch.

See #769.
2021-03-19 16:31:26 +00:00
Andy Stewart
7224d1d8d7 Ensure backward compatibility with 'previewpopup' option 2021-03-18 11:05:56 +00:00
Andy Stewart
f2a825f405 Use floating window for preview instead of popup 2021-03-17 14:30:49 +00:00
Andy Stewart
64062dfe02 Simplify opening of preview window 2021-03-16 12:06:31 +00:00
Andy Stewart
f3145958dd Make statusline blank in hunk preview window
I would prefer to remove the statusline altogether in the hunk preview
window, making it consistent with the floating preview window.  However
I do not think that is possible; the best one can do is make it blank.
2021-03-15 17:00:33 +00:00
Andy Stewart
2a0411c10c Revert GitGutterGetHunkSummary() to show hunks when inactive
In da77e46310 the function changed to be
consistent with GitGutterGetHunks(), i.e. to show "no data" if called in
a buffer for which gitgutter is inactive.

This function is mostly used in status lines.  GitGutter is inactive
when a popup window is open.  The commit mentioned above meant that when
a completion window was open, the hunk summary in the status line
changed to show no data.  It changed back again once the completion
window was closed, but the overall effect was a little distracting.

This commit reverts the change.

Closes #771.
2021-03-15 16:45:26 +00:00
Andy Stewart
1283ec1670 Make error message useful 2021-02-22 14:15:46 +00:00
Andy Stewart
b90aad666a Ensure GitGutterGetHunks() always returns a 3 element list
Thanks to @sebastianmarkow for pointing this out.
2021-02-16 18:04:12 +00:00
Andy Stewart
da77e46310 Make consistent with GitGutterGetHunks() 2021-02-16 16:05:41 +00:00
Andy Stewart
6019d43860 Ensure hunk summary is updated during a hunk op
Fixes #765.
2021-02-16 16:04:47 +00:00
acelya
2e3cd54ed6 Fix pwsh/powershell test when used with a parameters
Like `set shell=pwsh\ -NoLogo`.
2021-02-11 09:13:02 +00:00
Andy Stewart
d249be7f3c Update help doc
See #718.
2021-02-08 12:52:31 +00:00
Andy Stewart
f440ed04dd Enable <Esc> to close floating preview window
See #718.
2021-02-08 12:48:01 +00:00
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