Commit Graph

419 Commits

Author SHA1 Message Date
Lewis Russell d12442a924 fix(doc): remove <buffer> as a map argument 2021-10-22 15:52:35 +01:00
Lewis Russell a2a18c69bf fix(setqflist): prevent duplicates 2021-10-22 14:17:40 +01:00
Lewis Russell 18594357d0 doc(README): add non-goals 2021-10-18 18:01:17 +01: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 02b97995df Revert "feat(run_blame): get associated pull requests"
This reverts commit 552f114cae.

Change committed prematurely

Fixes #392
2021-10-18 13:07:55 +01:00
Lewis Russell 552f114cae feat(run_blame): get associated pull requests 2021-10-15 13:31:44 +01:00
Lewis Russell 8b0d921e72 fix(ci): update workflow with recent Makefile changes 2021-10-15 13:18:30 +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 ceb2dcb23f chore(docs): typo 2021-10-04 17:48:58 +01:00
Lewis Russell e73f9d84be chore(docs): document vim-fugitive as an integration 2021-10-04 17:46:28 +01:00
Lewis Russell 6c3ce729ba chore(docs): document vim-repeat as an integration 2021-10-04 17:20:55 +01:00
Lewis Russell de7d67087b refactor(): get_actions() 2021-10-04 16:47:53 +01:00
Lewis Russell 4698eab608 chore(doc): add integrations to README 2021-10-04 16:27:26 +01: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 3ea7129396 chore(doc): mention release tag in README
Resolves #380
2021-09-27 13:07:35 +01:00
Lewis Russell 4d8a6e0eb3 chore(doc): update README.md 2021-09-27 12:12:58 +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 7e5c1a831f chore(test): re-enable color in test output 2021-09-25 16:49:34 +01:00
Lewis Russell 9853349c47 chore(test): fix typo 2021-09-25 16:45:06 +01:00
Lewis Russell 85efb0002b chore(test): move test deps into subdir 2021-09-25 16:40:05 +01:00
Lewis Russell 8385d62f75 chore(misc): remove gen_async.lua 2021-09-25 16:32:53 +01:00
Lewis Russell 6d5c4a19e7 Handle carriage returns for dos files
fixes #369
2021-09-24 23:02:06 +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 b43360710e chore(ci): use master instead of nightly 2021-09-24 13:50:39 +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 fa1d21016c update rockspec 2021-09-22 10:47:50 +01:00
Lewis Russell 60403b46c6 fix(actions): don't spec signs if base is not index 2021-09-20 16:15:31 +01:00
Lewis Russell 9b18ea9bec Fix #367 2021-09-20 16:14:33 +01:00
dialetic 790368f973 fix(autocmd): end gitsigns_blame augroup properly 2021-09-20 15:51:06 +01:00
Lewis Russell 42acbae183 fix(nav_hunk): make foldopen! silent 2021-09-14 14:58:17 +01:00
Lewis Russell 7ce5ccc216 feat(nav_hunk): respect 'foldopen' when jumping 2021-09-14 12:43:46 +01:00
Lewis Russell cef4e6f26c fix(repeat): when preview is open
Fixes #262
2021-09-11 15:12:04 +01:00
Lewis Russell aa2522a6f3 fix(blame_line): don't error in fresh repo 2021-09-11 14:15:46 +01:00
Lewis Russell b40a771d25 fix(setqflist): handle modified submodules
Fixes #348
2021-09-09 17:16:48 +01:00
Lewis Russell 82ac00301a chore(jobs): Use simpler job implementation
This change removes the use of plenary's job API.

Whilst it has served us well up until now, there are several reasons why
it isn't well fit for Gitsigns and why a simpler implementation
will serve us better.

One of the key features of plenary jobs is that it provides on line
callbacks for reading stdout/stderr. Whilst these can be really useful,
they don't provide any benefits for Gitsigns which pretty much just
consumes the full output from all the processes it spawns. Additionally
the handlers are relatively complex and have been a source of problems.
These handlers also do a lot of processing by splitting data chunks and
searching for newline characters. This processing is wasted since we
concatenate the full output.

The new API simply returns two strings for stdout and stderr and it is
up to the caller on whether they need to split these into lines to
iterate over.

Plenary jobs were designed to be composed, chained together and
interrupted. To facilitate this, it has some fairly complex logic around
the uv pipe object handling to ensure they are correctly managed and
don't leak memory.

The new API simply opens the pipes, and closes them when the jobs
finish.

Plenary does a fair amount of input validation at runtime. While this is
useful for projects written in lua, since Gitsigns is implemented in
Teal, we can get all of these checks statically by implementing a job
API which is typed.
2021-09-09 17:03:24 +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 1e35306a90 fix #358 2021-09-09 15:34:15 +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 f46a89978c fix #353 2021-09-08 09:01:25 +01:00
Lewis Russell 72151be916 fix: bad autocmd calling async functions
Fixes: #352, #353, #354
2021-09-08 08:56:57 +01:00
Lewis Russell f2437cd95a fix: do delete undeclared vars 2021-09-07 17:00:48 +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 25d4b182ec fix: don't error on Ctrl-c in insert mode (#346) 2021-09-07 15:51:00 +01:00
Matthieu Coudron daa233aabb updated rockspec to account for missing diff_ffi.lua 2021-08-29 23:08:52 +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