Commit Graph

28 Commits

Author SHA1 Message Date
Lewis Russell
dd60a8845d feat(blame): added config.current_line_blame_formatter_nc
Used to format uncommitted lines.

Resolves: #476
2022-04-14 16:14:09 +01:00
Lewis Russell
d2e531bb3f feat(blame): control priority of blame
Added config.current_line_blame_opts.virt_text_priority

Resolves #513
2022-04-13 10:15:22 +01:00
Lewis Russell
9bd449cd62 fix(blame): don't enable in insert mode
Resolves #486
2022-03-28 14:55:26 +01:00
Lewis Russell
2a107231d9 refactor: vendor in async lib
- Typed teal implementation
- Better error diagnostics
- Removes dependency on plenary.nvim
2022-03-25 17:24:05 +00:00
Lewis Russell
865375407e refactor: use autocmd API 2022-03-03 15:55:40 +00:00
Lewis Russell
1d1f043acf fix(blame): reduce flicker when on same line
Fixes #461
2022-02-15 11:01:41 +00:00
Lewis Russell
420db8ddb9 feat(blame): support format strings
- 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
2022-02-13 15:23:41 +00:00
Lewis Russell
254e09dc59 fix(blame): only set virt text if there's a result 2022-01-14 11:20:12 +00:00
Fabian Viöl
9084e084f8 fix(blame_line): Do not omit carriage return
When blaming a line on a file, which as the "dos" fileformat
which is also checked in as a "dos" format including the
carriage returns, gitsigns.nvim currently reports
"Not yet commited" caused by an unsucessfull blame call
to git.

This commit fixes that behavior by appending the carriage
return lines again
2021-12-13 12:56:01 +00:00
Lewis Russell
6bad541a40 fix(blame): disable caching
Has some issues. Added config._blame_cache (defaults to false) so it can
be dog-fooded
2021-12-07 17:53:58 +00:00
Lewis Russell
119ebde2de feat(current_line_blame): add caching of blame 2021-12-02 14:52:38 +00:00
Lewis Russell
ba1932ab3e feat(blame): Allow to ignore whitespace
- blame_line() now takes a table as it's first argument (instead of a
boolean) with the fields "full" and "ignore_whitespace"

- Added config.current_line_blame_opts.ignore_whitespace

Resolves #400
2021-11-16 19:21:23 +00:00
Lewis Russell
cf0ee6c2fe fix(blame): improve race condition check 2021-10-18 17:37:26 +01:00
Lewis Russell
2a1f3e6e7f fix(blame): fix possible race condition
It is possible for the buffer to change during the async function. To
avoid this, before applying the extmark, check that the cursor is in the
same position. If it is the extmark should be ok to apply and at the
very least will avoid the `line value outside range` error.

Fixes #312
2021-10-18 17:23:12 +01:00
Lewis Russell
a6d1574bab Numerous changes to setqflist
- Fix duplicate items appearing (#370)

- Make setqflist/setloclist async again

- setqflist('all') now also looks in the current working directory

- Automatically open the quickfix/location list on completion

- Make setloclist an alias of setqflist

- Refactor git.tl so now there is a separate 'Repo' object to allows us
  to create git objects for a directory.

Fixes #370
2021-09-22 13:58:09 +01:00
dialetic
790368f973 fix(autocmd): end gitsigns_blame augroup properly 2021-09-20 15:51:06 +01:00
Lewis Russell
85817528ba fix(current_line_blame): set hl_mode='combine' on extmark
Fixes #336
2021-08-24 17:19:32 +01:00
Lewis Russell
58c958ec0e Rework options for current_line_blame
- Provide b:gitsigns_blame_line_dict for blame info for current line.
  Require config.current_line_blame = true.

- Added config.current_line_blame_opts

- Added config.current_line_blame_opts.virt_text. Can be disabled to
  disable virtual text. Useful if you want b:gitsigns_blame_line_dict
  but without the blame annotation.

- Moved config.current_line_blame_delay to
  config.current_line_blame_opts.delay

- Moved config.current_line_blame_pos to
  config.current_line_blame_opts.virt_text_pos

- Added deprecation handling for old options

Resolve #199
2021-08-21 20:14:34 +01:00
Lewis Russell
b38008cf24 async: require plenary.async -> plenary.async.async
plenary.async requires several modules not used by gitsigns which is
inflating the startup time. Instead just require plenary.async.async.

On an M1 Macbook this appears to half the startup time of gitsigns.
2021-08-02 12:31:56 +01:00
Lewis Russell
d5b12da2a6 Improve docs 2021-07-06 12:30:09 +01:00
Andreas Palm
fc7c085408 current_line_blame: Add relative date 2021-07-05 18:05:23 +01:00
Lewis Russell
486f262864 Migrate to plenary async2 2021-06-21 15:25:48 +01:00
Lewis Russell
aae1c4f5b8 Clear current line blame when leaving a buffer
Resolves #225
2021-06-16 09:59:31 +01:00
Lewis Russell
c3712af768 Fix #218 2021-06-11 16:56:43 +01:00
Lewis Russell
7a9edbdcd0 Refinements to blame timeout 2021-06-11 16:16:45 +01:00
Anders Evenrud
ec378370ea Added configurable timeout for blame virtual text
Use a custom timer instead of relying on CursorHold to detach the blame
virtual text from `updatetime`.
2021-06-11 16:16:45 +01:00
Anders Evenrud
ecffcf6144 Configurable blame virtual text position 2021-06-06 10:20:27 +01:00
Lewis Russell
6f9ffb94b4 Refactor gitsigns.tl
- Break into separate files
- Should slightly improve startup time.
- Removed update() from public API
2021-05-29 11:23:11 +01:00