Previously current_line_blame would run a git-blame process per line
(via the `-L` flag) in an attempt to be more efficient. However after
some investigation it seems that running git-blame for the entire file
rarely exceeds 2x the time it takes to run for a single line, even for
large files.
This change alters current_line_blame to run git-blame for the entire
file after each buffer edit and caches that in memory. This makes the
first git-blame after an edit ~2x slower, but makes any cursor movements
after that instant.
A follow-up to this would be for current_line_blame to track buffer
updates to avoid the cache needing to be invalidated on every edit.
(experimental)
Uses a second buffer and a floating window in order to display syntax
highlighting in the deleted lines.
Need to set `_inline2 = true` in `setup()` to enable.
When using `current_line_blame = true` with a highlight that defines a
`bg`, the virtual text has a space at the beginning but not at the end.
This looks a bit off (e.g.: the virtual text looks like a small label
with the text not properly aligned).
This is invisible when using a highlight without `bg`.
This small changes adds a space at the end so that virtual text in such
situations makes better sense visually.
Fixes: https://github.com/lewis6991/gitsigns.nvim/issues/745
- Deprecated config.signs.*.[hl,numhl,linehl].
In the future the highlight groups will be hard defined and should be
configured directly by the user using `nvim_set_hl` or `:highlight`.
- Added documentation for all used highlights.
- Added specific highlights for 'topdelete', 'changedelete', and 'untracked'
signs.
Added config.worktrees.
Array of tables with the keys 'gitdir' and 'toplevel'.
If attaching normally fails, then each entry in the table is attempted.
Example:
worktrees = {
{
toplevel = vim.env.HOME,
gitdir = vim.env.HOME .. '/projects/dotfiles/.git'
}
}
Resolves#397
When running an action via the :Gitsigns command, the internal plumbing
can now pass the entire command context/options directly to a
specialised action command (per action) that knows how to translate
command parameters to the specific action parameters.
Example #1: `:belowright Gitsigns diffthis` now translates to
`diffthis(nil, {split='belowright'}`.
Example #2: `:6,10Gitsigns stage_hunk` now translates to
`stage_hunk({6,10})`.
Note this change reverts the behaviour of the previous commit that
respects 'splitright'
Fixes#585
Setting GitSignsDeleteLn to anything by default doesn't make much sense
since it ends up highlighting lines not related to the hunk. This is
especially confusing when show_deleted is enabled.
+ Fix incorrect docs.
Fixes#565
- When running diffthis (or vim-fugitive's Gdiffsplit), hunk operations
to the index will now update the diff buffer.
- Similar to vim-fugitive's Gdiffsplit, buffers of a file in the git
index can now be edited. When the buffer is written, it updates the
git index accordingly. Likewise the index buffer can also be reloaded
(via 'edit').
- Moved all diffthis code to a separate module.
Fixes#501
- config.current_line_blame_formatter can now be specified as a format
string.
- changed default of `config.current_line_blame_formatter` to
'<author>, <author_time:%R> - <summary>' which is equivalent to the
previous function default.
- deprecated config.current_line_blame_formatter_opts
Resolves#291
- Added GitSigns*Inline and GitSigns*LnInline to be used with word diff
- GitSigns*LnInline is used for word diff with config.word_diff
- GitSigns*Inline is used for word diff in hunk previews
- Added GitSigns*VirtLn and GitSigns*VirtLnInline to be used with
`config.show_deleted`.
- Define GitSigns highlights conditionally as opposed to only defining
them if certain features are enabled.