Commit Graph

88 Commits

Author SHA1 Message Date
Lewis Russell
fa1e8c589a feat(signs): different add signs for untracked files
Resolves #569
2022-11-07 10:40:47 +00:00
Lewis Russell
666edc7ba4 fix(test): set merge.conflictstyle 2022-10-07 14:20:57 +01:00
Lewis Russell
f623543458 chore(ci)!: drop support for v0.6.x 2022-10-07 14:02:11 +01:00
Lewis Russell
a0cd6ccd73 chore!: remove deprecated fields 2022-09-13 09:28:42 +01:00
Lewis Russell
50e32c6309 feat: support for detached working trees
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
2022-08-10 11:15:42 +01:00
Lewis Russell
44372ff5dc fix: improve fix for #521 2022-05-24 11:45:33 +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
b290aed76f refactor: move unit tests 2022-05-02 14:42:15 +01:00
Lewis Russell
329ffe6820 feat(command): implement argparser 2022-05-02 14:16:18 +01:00
Lewis Russell
61c8398b0d test: improve unit tests 2022-05-02 12:23:51 +01:00
Lewis Russell
9b3899a610 refactor(signs): simplify interface 2022-04-22 12:32:18 +01:00
Lewis Russell
498abfa13d refactor: OOP signs 2022-04-19 16:25:32 +01:00
Lewis Russell
d0b42c0fc7 fix(git): add --literal-pathspecs 2022-04-15 16:45:16 +01: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
lschwahn
2fa3716bc4 fix: gitsigns in fugitive buffer not visible 2022-01-29 18:13:36 +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
d19029adca fix(): support filepaths with unicode characters
Fixes #447
2022-01-20 17:20:43 +00:00
Sergey Kuznetsov
7aad5257fa Hope the last tests fix 2022-01-11 16:16:47 +00:00
Sergey Kuznetsov
ee5e46450e Another try to fix tests 2022-01-11 16:16:47 +00:00
Sergey Kuznetsov
cf8e4df8d8 Fix tests 2022-01-11 16:16:47 +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
caf51af051 fix(windows): Fix CRLF handling
Fixes #410
2021-12-08 22:15:22 +00:00
Lewis Russell
f362e54e11 feat(actions): true partial hunk staging
Resolves #338
2021-12-04 18:38:52 +00:00
Lewis Russell
805b12a9b7 chore(refactor): refactor Hunk object
So added and removed lines are kept in separate tables
2021-09-27 13:11:12 +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
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
aa2522a6f3 fix(blame_line): don't error in fresh repo 2021-09-11 14:15:46 +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
3cd0656e14 handle deprecated fields more generically 2021-09-09 12:34:09 +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
5655cfa4c0 fix(update): issue speculative signs persisting
Speculative signs are added immediately whereas updates are debounced
and throttled for each buffer. If we perform two quick updates which
result in a sign begin added then removed, we need to make sure
speculative signs don't incorrectly persist. Example:

  -> buffer change
     - speculative signs (#1)
     - update (#1)
  -> undo (quickly after buffer change)
     - speculative signs (#2)
     - update (#2)

Update #1 is dropped due to the debounce which results in update #2 not
updating signs due to the hunks not changing. Since signs are never
updated, the speculative signs #1 and #2 will persist.

To get around this, we just need to invalidate the hunks to force a sign
refresh.
2021-08-28 12:23:01 +01:00
Lewis Russell
083dc2f485 Add short SHA when rebasing + test 2021-08-09 21:58:59 +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
fecff8b866 Tidy up tests 2021-08-03 22:48:48 +01:00
Lewis Russell
605166b6f6 Add get_hunks()
Resolves #242
2021-08-03 18:44:54 +01:00
Lewis Russell
fc170b4ed2 Don't re-apply signs if hunk heads don't change
Resolves #273
2021-08-03 11:08:22 +01:00
Lewis Russell
a50bf388be test: Make all tests run with ext_messages 2021-08-02 11:37:52 +01:00
Lewis Russell
dfc49f8be2 debug: Add trigger info to attach() 2021-08-02 11:30:00 +01:00
Lewis Russell
fe084521ac Disable during vimgrep
Fixes #284
2021-08-02 11:10:32 +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
ee454e1846 Improve highlight derivation
- Simplify code
- Search for more known highlight groups, e.g:
    - GitGutterAdd
    - SignifySignAdd
    - DiffAddedGutter
    - diffAdded
    - DiffAdd'
2021-06-26 14:22:13 +01:00
Lewis Russell
4ee167ded8 feat: Follow files when they move in the index 2021-06-25 17:00:15 +01:00
Lewis Russell
a272a8df25 test: Avoid using screen:expect and count signs instead 2021-06-23 16:57:42 +01:00
Lewis Russell
d22de18f9d Rework testsuite
- Make tests more asyn friendly and remove most of the magic sleeps
- Break up into multiple files
- Bypass cmake
2021-06-23 11:41:48 +01:00
Lewis Russell
3b303ecba3 Update after change_base 2021-06-19 16:30:56 +01:00
Lewis Russell
912df11b46 feat: Add config.on_attach()
- Callback to set keymaps (instead of config.keymaps) and to control
  whether to attach to a buffer.
- Documented how extended table configuation fields work.
- Removed non-buffer mappings and `buffer=true` from the default.

Resolves #155
2021-05-30 16:35:14 +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
Lewis Russell
c00f5f26fd Added diffthis()
Analogous to fugitives :Gvdiffsplit, see :help gitsigns.diffthis()

Resolves #14
2021-05-27 14:34:44 +01:00
Lewis Russell
80cb1dc5ff Detect when file is in a custom git dir
Fixes #193
2021-05-17 11:42:51 +01:00
Lewis Russell
dc0f6d895b Add config.attach_to_untracked
Resolves #68
2021-04-24 16:59:51 +01:00