Commit Graph

98 Commits

Author SHA1 Message Date
Lewis Russell
3b2e7b668c feat: add show action
Similar to diffthis, except diff mode is not enabled.
2022-05-26 11:44:35 +01:00
Lewis Russell
13f811e8eb fix: don't set default for GitSignsDeleteLn
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
2022-05-22 10:15:25 +01:00
Lewis Russell
ef153188e8 doc: fix indent_heuristic type
Closes: #509
2022-05-02 14:56:01 +01:00
Lewis Russell
0c7da98aab refactor(preview): use format string for windows 2022-04-17 12:59:58 +01:00
Lewis Russell
318a93bc92 doc: update 2022-04-15 17:03:36 +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
4a68d2a373 feat(toggle): return current value
Fixes #506
2022-04-10 10:52:03 +01:00
Lewis Russell
acdd74bc6c feat(diffthis): various improvements
- 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
2022-04-09 08:23:31 +01:00
Lewis Russell
8fce869b67 doc(mappings): update 2022-03-28 14:58:32 +01:00
Lewis Russell
7ff03e1eba feat(nav): add option to auto preview
Resolves #494
2022-03-25 17:03:52 +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
4a2d30f5fb fix(actions): diffthis fixes
- Added config.diff_opt.vertical
- When running diffthis, only enable diffmode on the correct windows.

Fixes: #456, #455
2022-01-26 18:02:18 +00:00
Lewis Russell
79fd1ec426 chore(config)!: hard deprecate fields
Any fields that were deprecated during v0.4 cycle are now
hard-deprecated. They can still be used, but now a warning will appear
on startup.
2022-01-26 17:41:19 +00:00
Lewis Russell
b4548e4c60 refactor(highlights)!: rework highlights
- 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.
2022-01-26 17:33:24 +00:00
Lewis Russell
58e5d6d85e refactor!: deprecate config.keymaps
BREAKING CHANGE: Removed default keymaps. Instead on_attach should be
used. See README.md.
2022-01-22 09:26:27 +00:00
Lewis Russell
584e1abfb9 feat(): show old version of hunks via virtual lines
Use virtual lines to show the old version of hunks inline in the buffer.

- Added config.show_deleted
- Added toggle_deleted()
2022-01-14 17:05:25 +00:00
Lewis Russell
5eb87a0b05 Automate docs more
- Move function docs to comments in actions.tl
- Rewrite gen_help.lua to use a template
- Keep README and help full setup example in sync
2021-12-06 18:02:22 +00:00
Lewis Russell
edbc935f50 feat(setqflist): Add 'open' option
If true, open the qf/loc list viewer. Defaults to true.

Resolves #415
2021-12-04 18:48:47 +00:00
Lewis Russell
f362e54e11 feat(actions): true partial hunk staging
Resolves #338
2021-12-04 18:38:52 +00:00
Lewis Russell
0ffa5a082e Change mappings to use Gitsigns command 2021-12-04 18:38:52 +00:00
Andreas Schneider
1805679095 fix(blame): Adapt default config to latest blame changes 2021-11-18 15:30:14 +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
d12442a924 fix(doc): remove <buffer> as a map argument 2021-10-22 15:52:35 +01:00
Lewis Russell
fc81385888 feat(integration): Use trouble.nvim
If installed and enabled (via `config.trouble`; defaults to true if
installed), `:Gitsigns setqflist` and `:Gitsigns seqloclist` will
open Trouble instead of Neovim's built-in quickfix or location list
windows.
2021-10-15 13:18:30 +01:00
Lewis Russell
de7d67087b refactor(): get_actions() 2021-10-04 16:47:53 +01:00
Lewis Russell
c81aa3b690 feat(deprecated): only warn hard deprecations
Add deprecations to doc.

When fields are now initially deprecated, no warning messages will be
displayed. However if a deprecated field is marked with hard, then a
warning will be issued.

At the beginning of each release cycle, all deprecated fields will be
marked as hard and fields that were already marked as hard will be
removed.
2021-09-27 12:09:47 +01:00
Lewis Russell
9fce554204 chore(misc): remove all referenced to watch_index
... and replace with watch_gitdir
2021-09-27 11:28:25 +01:00
Lewis Russell
489fe088c4 fix(watcher): watch gitdir instead if index
Some git command likes `git checkout -b` do no update .git/index.
Instead watch the git dir itself to capture all git operations.

Renamed config.watch_index -> config.watch_gitdir

Fixes #377
2021-09-24 16:30:10 +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
Lewis Russell
d11b627d5a doc: mark functions with {async} 2021-09-22 12:36:23 +01:00
Lewis Russell
7ce5ccc216 feat(nav_hunk): respect 'foldopen' when jumping 2021-09-14 12:43:46 +01:00
Lewis Russell
52c05ccfda feat(cli): parse cli arguments as lua values
Allows commands like:
  :Gitsigns change_base nil true
2021-09-09 16:50:40 +01:00
Tobias Schmitz
913d198db8
Add persistent diff base setup option (#349)
Co-authored-by: Lewis Russell <lewis6991@gmail.com>
2021-09-09 16:05:29 +01:00
Lewis Russell
34deec2813 Add config.diff_opts and deprecate fields
- DEPRECATED diff_algorithm
    replaced with diff_opts.algorithm

- DEPRECATED use_internal_diff
    replaced with diff_opts.internal

- ADDED diff_opts.indent_heuristic
2021-09-09 13:58:07 +01:00
Lewis Russell
7e5a748f34 feat: add g:gitsigns_head
Head value based on cwd

Resolves #344
2021-09-07 16:31:49 +01:00
Lewis Russell
3376ac8d4a feat(blame_line): Show hunk in preview
... if {full} is true
2021-08-23 18:37:20 +01:00
Lewis Russell
1ddb1f64f5 Add support for vim.xdl_diff
Requires PR neovim/neovim/#14536
2021-08-23 12:43:21 +01:00
figsoda
368c7f65aa fix(doc): duplicate tag gitsigns-config-current_line_blame 2021-08-22 21:10:15 +01:00
Lewis Russell
cbb1c32c98 fix(doc): Typo in current_line_blame_opts 2021-08-21 20:19:11 +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
Evgeni Chasnovski
b758762824 Update status to return short commit hash in detached HEAD.
Fixes #292.
2021-08-09 21:58:59 +01:00
Sebastian Baroni
41b67615d6 remove use_decoration_api from README.md and docs
* remove use_decoration_api from README.md

* remove use_decoration_api from docs
2021-08-06 17:58:39 +01:00
Lewis Russell
3a477a0356 Remove config.use_decoration_api
The decoration provider is now always used.
2021-08-05 15:33:31 +01:00
Lewis Russell
605166b6f6 Add get_hunks()
Resolves #242
2021-08-03 18:44:54 +01:00
Lewis Russell
a7420d8167 feat: Add setqflist and setloclist
Set the quickfix/location list with hunks from either:
- A specific buffer
- All attached buffers
- All modified files for each gitdir of each attached buffer
2021-07-29 09:28:18 +01:00
Lewis Russell
0180dfd7ae Refactor diff code
- Simplify external diff code and make it's api consistent with FFI diff.
- Move diff code into separate modules diff_ext and diff_ffi.
2021-07-21 16:09:20 +01:00
Lewis Russell
ecc58e7be8 Fix mappings for buffers opened in the background
- Remove references to `buffer = true` in the docs.

Fixes #266
2021-07-19 17:01:39 +01:00
Lewis Russell
90e71f866b Rework status vars
- Add root dir and git dir to b:gitsigns_status_dict (resolves #259)
2021-07-16 15:45:35 +01:00
Lewis Russell
a2ec5531bb Document toggle_word_diff() 2021-07-07 14:01:03 +01:00