Commit Graph

167 Commits

Author SHA1 Message Date
Artem Vasenin 1ef74b5467 docs: update docs 2024-09-04 13:41:33 +01:00
Artem Vasenin 2667904fb0 feat(blame_line): add option to show when not focused 2024-09-04 13:41:33 +01:00
Anton Rybianov b29cb58126 feat: add highlights for the current line 2024-07-24 09:07:10 +01:00
MithicSpirit 2a7b39f4d2 fix: help triggering text autocmds
The default filetype detection algorithm only checks the last lines of
.txt files for "ft=help" before setting the filetype to "text". Since
there was an empty line at the end, the help page was getting marked as
having filetype text first, and then help, which meant both autocmds
were triggered. This fixes that by removing the extraneous newline; note
that there is still a newline at the end of file, as is customary, and
this just removes the second, unnecessary newline.

Furthermore, this simplifies the logic for "gen_help.lua" and increases
its robustness by using the "io.lines" function rather than reading the
entire file as a string and using regular expressions to split it into
lines.
2024-07-16 06:55:15 +01:00
Daniel Ebrahimian d44a7948ff fix(docs): Add signs_staged to default config in README
Update doc file
2024-07-03 10:47:57 +01:00
Lewis Russell 93c38d9726 fix(blame): popupmenu error
Fixes #1061
2024-06-21 12:57:27 +01:00
Lewis Russell 9cdfcb5f03 perf(blame): some improvements
- Ensure ':Gitsigns blame' utilizes the blame cache.
- Rewrite the blame runner to process output incrementally.
- Make the blame cache more efficient.
- Move the blame processing code to a separate module.
2024-06-20 12:26:55 +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
Lewis Russell 61f5b64076 feat!: remove support for yadm 2024-06-19 14:37:25 +01:00
Lewis Russell 9291836665 feat(nav): add target option
Allows `nav_hunk` to target staged, unstaged or all hunks.
2024-06-19 12:15:06 +01:00
Lewis Russell 25b6ee4be5 feat(blame): add `Gitsigns blame`
Similar to fugitive blame.

Use `<CR>` on a commit line to open a menu with additional actions.

Release-As: 1.0.0
2024-06-18 17:08:59 +01:00
Lewis Russell b8cf5e8efa feat(signs): able staged signs by default 2024-06-13 12:01:16 +01:00
github-actions[bot] 0b04035bb7 chore(main): release 0.9.0 2024-06-13 11:56:19 +01:00
Lewis Russell 720061aa15 feat(setup)!: make setup() synchronous
Previously `setup()` was asynchronous in order to run a system command
to check the git version.

As support for v0.8 is dropped, this is no longer required.
2024-05-28 09:35:46 +01:00
Lewis Russell d9d94e055a feat!: drop support for nvim v0.8 2024-05-23 09:39:58 +01:00
github-actions[bot] 76927d14d3 chore(main): release 0.8.1 2024-04-30 16:34:47 +01:00
github-actions[bot] 52f8da33cc chore(main): release 0.8.0 2024-04-17 17:19:33 +01:00
Lewis Russell f0447b734e ci: release-please 2024-04-17 17:16:07 +01:00
Lewis Russell c02516144a
refacto: misc refactoring (#983) 2024-04-16 17:27:19 +01:00
Lewis Russell ec6aab13ef feat(autocmd) add GitSignsChanged
Resolves #507
2024-04-05 14:19:06 +01:00
Lewis Russell 59bdc1851c feat(nav): add nav_hunk()
- Deprecated `next_hunk()` and `prev_hunk()`.
- Can now navigate to the first/last hunk using `nav_hunk('first'|'last')`.
- Added `count` to navigation options. Defaults to `v:count1`.
- Updated recommended keymaps for navigation.
- Navigation actions now navigate to the first non-blank column.
2024-04-05 13:35:49 +01:00
Lewis Russell 3358280054 feat(blame): support extra options
Closes #953
Resolves #959
2024-04-04 14:15:15 +01:00
Lewis Russell 1389134ba9 fix: trigger GitSignsUpdate autocmd more often
Resolves #831 #832
2024-04-04 11:40:34 +01:00
Lewis Russell 224a319eda docs: add documentation for current_line_blame_formatter_opts.relative_time
Closes #912
2024-04-04 10:25:32 +01:00
Luke Franceschini 22c0ab8ec2 docs: change README.md configuration signs to match actual defaults
The default text sign for add and change is a "Box Drawings Heavy
Vertical" (U+2503). However, README.md uses "Box Drawings Light
Vertical" (U+2502) in its configuration for these signs. This
commit changes the sample configuration to match the actual defaults
used in the code, which then gets propagated to gitsigns.txt when
running gen_help.lua.

This way someone who wants to use the same symbol for untracked as add
and change, as I did, gets the same character when they copy and paste
from the documentation into their config.
2024-04-03 17:20:39 +01:00
Lewis Russell 0994d89323 feat(blame): add rev option to blame_line()
Resolves #952
2024-04-03 12:01:50 +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 a4db718c78 fix: bad deprecation message
Fixes #965
2024-04-02 09:32:53 +01:00
Lewis Russell 1bb277b41d feat(yadm): deprecate 2024-04-01 18:18:11 +01:00
hankertrix 2c2463dbd8 fix(docs)!: Use the new attached_to_untracked setting 2024-01-27 16:20:32 +00:00
Lewis Russell fb9fd53124 fix(hl): highlights for Nvim v0.9
Resolves #939
2024-01-26 15:21:23 +00:00
Lewis Russell 590d077c55 feat!: change default of attached_to_untracked to false 2024-01-25 16:48:27 +00:00
Sebastian Lyng Johansen 300a306da9 fix: use documented highlight groups as fallback 2024-01-23 19:18:12 +00:00
martinra 3e6e91b09f
feat: configurable auto attach (#918)
* feat: configurable auto attach

* fixup! feat: configurable auto attach
2024-01-05 11:42:32 +00:00
rafascar af0f583cd3 fix(README): add default config.current_line_blame_opts.virt_text_priority 2023-10-26 12:06:58 +01:00
Lewis Russell d05a21795c chore: tidying 2023-10-05 14:14:33 +01:00
Lewis Russell 317c98d64c feat(diff): allow to diff against the working version
The `base` can now be set to `FILE` to diff against the working version.

Resolves #164
2023-10-02 12:14:20 +01:00
Lewis Russell 8aedc8b15a feat(diffopt): add support for whitespace flags in diffopt
Resolves #696
2023-10-02 11:22:42 +01:00
Lewis Russell e308a4f5dd build: add doc and lint check 2023-09-23 11:13:14 +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 c7d963b257 docs: annotate codeblocks with lang 2023-09-22 12:24:42 +01:00
Lewis Russell fd4d953614 docs: make gen_help.lua emmy aware 2023-07-10 13:52:01 +01:00
Lewis Russell 3a6f1e296d docs: update 2023-06-19 13:22:31 +01:00
Lewis Russell 256569c2fe feat!: remove config.keymaps 2023-06-16 16:57:41 +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 8ad98db42a feat: add comments to generated lua files 2023-02-16 11:09:17 +00:00
Hugo Osvaldo Barrera f5d7b441fc fix: add space at the end of blame virtual text
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
2023-02-15 11:31:33 +00:00
Sindre T. Strøm ec4742a7ee
feat: Enable `attach()` to work with any buffer when given context data
* feat: Enable `attach()` to work with any buffer when given context data.

* fix(test): Pattern escape file names when matching debug messages.
2023-02-03 09:25:22 +00:00
Lewis Russell 414aa7bc08 fix(highlight): several fixes from last PR 2023-01-11 10:21:45 +00:00