Commit Graph

71 Commits

Author SHA1 Message Date
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
Lewis Russell
d5b12da2a6 Improve docs 2021-07-06 12:30:09 +01:00
Andreas Palm
fc7c085408 current_line_blame: Add relative date 2021-07-05 18:05:23 +01:00
Andreas Palm
59188e1b08 Added new opts field docs 2021-07-05 16:36:40 +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
0e2a30e2b5 feat: Live word diff 2021-06-25 17:12:27 +01:00
Lewis Russell
4ee167ded8 feat: Follow files when they move in the index 2021-06-25 17:00:15 +01:00
Lewis Russell
af16b84a3d Re-add lost docs and document cli and revisions 2021-06-23 14:26:14 +01:00
Sindre T. Strøm
a2a8f2eb59 feat: Stage all hunks in selected range.
Type definitions.

Implement range for reset_hunk. Fix create_patch. Update docs.

Note on the `create_patch` fix: The block header generated by this
function was previously not considering changes made by previously
processed hunks. This was causing patches to be applied incorrectly when
staging multiple hunks.

Update lua files.

Un-async reset_hunk.

Store user provided range in var. Adjustments based on feedback.

Updated lua files.

Removed unused import.
2021-06-15 15:48:39 +01:00
Anders Evenrud
ec378370ea Added configurable timeout for blame virtual text
Use a custom timer instead of relying on CursorHold to detach the blame
virtual text from `updatetime`.
2021-06-11 16:16:45 +01:00
Anders Evenrud
ecffcf6144 Configurable blame virtual text position 2021-06-06 10:20:27 +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
25f5c0dc2e Add get_actions()
Return a list of all the available actions for the current line.

Resolves #179
2021-05-30 11:05:00 +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
cd150ba216 Version 0.1 2021-05-27 14:11:25 +01:00
Lewis Russell
d34051b793 Include full commit message in blame_line()
Resolves #173
2021-05-06 12:56:09 +01:00
Lewis Russell
581d71bc85 feat: Add change_base()
Allows to diff against any revision. See docs for more details.
2021-05-06 12:06:56 +01:00
Lewis Russell
c41247abeb Simplify floating window creation
- config.preview_config now contains the true defaults
- No longer apply additional window highlights
- Refactor and simplify

Resolves #170
2021-05-03 19:00:56 +01:00
Lewis Russell
22b762ed66 Remove uses of loadstring + doc tweaks 2021-05-02 10:08:02 +01:00
Lewis Russell
361f908ba0 Update README and docs 2021-05-01 11:02:07 +01:00
Lewis Russell
dc0f6d895b Add config.attach_to_untracked
Resolves #68
2021-04-24 16:59:51 +01:00
Lewis Russell
50c5122c84 Add config.preview_config
Used to customise the preview window.

Resolves #159
2021-04-24 16:59:41 +01:00
Lewis Russell
dddd7b3f1e Add support for yadm
Resolves #83
2021-04-10 19:33:35 +01:00
Tomáš Kallup
618601d2dc Implemented stage_buffer and reset_buffer_index
This allow users to run `lua require"gitsigns".stage_buffer()` to stage
all changes in a buffer and `lua require"gitsigns".reset_buffer_index()` to
unstage all changes in a buffer.

Added `ensure_file_in_index` to make sure files are tracked before
staging hunks.
Added `clear_status` to status, to clear only modifications (added,
changed, removed)

Added tests for `stage_buffer` and `reset_buffer_index`

Closes: #127
2021-04-06 10:51:27 +01:00
Lewis Russell
654e16b6ff Feature: Add blame info as virtual text
- Enable with config.current_line_blame.
- Customise formatting with config.current_line_blame_formatter.
2021-04-01 12:34:48 +01:00
Lewis Russell
e22e37897a Rename text_object() -> select_hunk() 2021-03-28 17:29:26 +01:00
Lewis Russell
cab7639080 Add config._refresh_staged_on_update
Defaults to true (current behaviour). Disabling will cause the staged
file to be only be updated when the index changes resulting in less jobs
and better performance. Marking as undocumented as there *may* be cases
where updates of the staged files don't happen when they should.

Also expose refresh() in case the above issue ever occurs.
2021-03-23 10:50:34 +00:00