Commit Graph

66 Commits

Author SHA1 Message Date
Artem Vasenin
2667904fb0 feat(blame_line): add option to show when not focused 2024-09-04 13:41:33 +01:00
Lewis Russell
82bc6225e9 refactor: organize imports 2024-07-03 12:08:06 +01:00
icefed
6b1a14eabc fix(blame): show current buffer line blame immediately
fix a problem caused by commit: 8df63f2ddc
2024-06-28 15:09:48 +01:00
Lewis Russell
0e39e9afcf fix: toggle_current_line_blame
Fixes #1072
2024-06-27 09:53:37 +01:00
Lewis Russell
8df63f2ddc fix(blame): update current_line_blame when attaching 2024-06-21 15:21:24 +01:00
Lewis Russell
d03a1c9a10 fix(blame): include error message in error 2024-06-21 15:04:28 +01:00
Lewis Russell
9ca00df1c8 feat(blame): run formatter with pcall
If it fails, use the default format.
2024-06-20 15:00:12 +01:00
Lewis Russell
92a8fbb845 feat!: remove current_line_blame_formatter_opts
- Also make relative time the default time format for current_line_blame_formatter
- When `current_line_blame_formatter` is passed as a function it is no
  longer passed an opts argument.
2024-06-19 14:51:26 +01:00
Josh Pencheon
20f305d63b fix(blame): avoid right-aligned blame overlapping buftext
When the blame text's length exceeds the available space to
the right of the buffer's text, the intention is to switch
to the 'eol' extmark placement. However, there were a number
of issues that could trip up the time at which it swtiches
to 'eol':

- if the buffer line or virtual text contain multibyte characters,
  they weren't counted properly in terms of screen cells that they'd
  consume
- incorrect window identifer was passed when calculating the
  available space, meaning that signs/folds/numbers columns
  weren't properly accounted for
2024-05-23 08:35:41 +01:00
Lewis Russell
7e38f07cab fix(blame): check win is valid after running blame 2024-04-18 10:13:44 +01:00
Lewis Russell
c02516144a
refacto: misc refactoring (#983) 2024-04-16 17:27:19 +01:00
Lewis Russell
c0936237f2 fix: check for WinResized 2024-04-05 13:09:45 +01:00
Lewis Russell
fa052c20aa chore: format 2024-04-04 14:56:32 +01:00
Lewis Russell
f0733b793a fix(current_line_blame): update on WinResized
Fixes #966
2024-04-04 14:54:44 +01:00
Lewis Russell
4e90cf984c feat(actions): add callback to async actions
- simplify async code

Fixes: #906, #766
2024-04-03 11:30:19 +01:00
Lewis Russell
795e0bda58 fix(current_line_blame): fix window target 2023-10-04 14:08:20 +01:00
Lewis Russell
bdeba1cec3 perf(blame): better cache invalidation
The blame cache is now maintained in the CacheEntry object
and invalidated incrementally on buffer updates.

In addition git-blame is bypassed if the cursor line is within a hunk.
2023-09-24 17:01:12 +01:00
Lewis Russell
bd0f4d518d fix: stylua 2023-09-23 10:13:35 +01:00
Lewis Russell
e2b8e61ce0 fix(blame): trim virt_text when using right_align
Fixes #870
2023-09-22 16:01:54 +01:00
Lewis Russell
b018a2b139 perf(blame): run blame for entire file instead of per line
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.
2023-09-22 12:24:42 +01:00
Lewis Russell
c4c5f7907c fix(blame): do not run concurrent processes
Fixes #877
2023-09-22 12:24:42 +01:00
luokai
d927caa075 fix(blame): If it has been detached, the cache[bufnr] is nil 2023-09-02 07:25:39 +01:00
Lewis Russell
5a2b120584 fix: check valid buffer when scheduling 2023-08-17 11:40:27 +01:00
Lewis Russell
dc2962f7fc fix(blame): don't run concurrent blames
Fixes: #783
2023-07-04 11:53:50 +01:00
Lewis Russell
6f97c573b5 chore: more emmy types 2023-06-16 16:31:27 +01:00
Lewis Russell
92654646f8 refactor: post teal-pocolypse cleanup
- assume vim.iconv
2023-06-14 12:02:18 +01:00
Lewis Russell
4d63d996b0 refactor: remove teal 2023-06-13 15:32:14 +01:00
Lewis Russell
319a248e4c feat(preview): improved version of preview_hunk_inline()
(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.
2023-04-28 11:38:38 +01:00
Lewis Russell
f388995990 feat: add more comments to generated lua files 2023-02-16 11:22:47 +00:00
Lewis Russell
8ad98db42a feat: add comments to generated lua files 2023-02-16 11:09:17 +00:00
Lewis Russell
903ebbb3e5 refactor: some style changes 2022-12-16 10:54:43 +00:00
Lewis Russell
4313a1f9c2 feat: add b:gitsigns_line_blame
Resolves #573
2022-11-07 11:59:55 +00:00
Lewis Russell
233e65a521 chore: update API usage 2022-10-07 15:57:33 +01:00
Lewis Russell
acc439a485 refactor(compat): remove v0.6.0 compat 2022-10-07 15:46:32 +01:00
Lewis Russell
ceafc3149e feat(uv): make sure all handles are closed 2022-08-31 15:56:25 +01:00
Lewis Russell
7639b7f741 fix(blame): prevent debounce from killing setup() 2022-08-10 11:33:21 +01:00
Lewis Russell
27aeb2e715 fix(blame): don't lag on folded lines 2022-05-26 12:55:53 +01:00
Lewis Russell
0c7da98aab refactor(preview): use format string for windows 2022-04-17 12:59:58 +01:00
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