Commit Graph

24 Commits (7e85fd5b77aa9b0898ddccfb834e36801db31825)

Author SHA1 Message Date
kanielrkirby f0282689da
Use `try_lock` in `diff_handle` for Diff gutter (#11092)
* Use `try_lock` in `diff_handle` for Diff gutter
- Add the method `try_load() -> Option<Diff>` to `DiffHandle`, using `try_lock` to avoid deadlocks.
- Use said method in `gutter.rs diff()`, which will use a blank `GutterFn` instead when met with a locked `Diff`.

* Revert changes

* Replace `Mutex` with `RwLock` in `Diff`

---------

Co-authored-by: Kaniel Kirby <pirate7007@runbox.com>
3 months ago
Michael Davis ff6aca12b7
Reset all changes overlapped by selections in ':reset-diff-change' (#10178)
This is useful for resetting multiple changes at once. For example you
might use 'maf' or even '%' to select a larger region and reset all
changes within.

The original behavior of resetting the change on the current line is
retained when the primary selection is 1-width since we look for chunks
in the line range of each selection.
6 months ago
Michael Davis 5c11af1479 `cargo fmt` 6 months ago
Alexis (Poliorcetics) Bourget 615d34a237 nit: remove unused `ceiling_dir` param 7 months ago
Alexis (Poliorcetics) Bourget f1461b49fa cleanup: remove useless Git struct, using free functions instead 7 months ago
Alexis (Poliorcetics) Bourget 918dd3fa37 cleanup: remove dummy diff provider, it's the exact same as not having one 7 months ago
Jonathan LEI a224ee5079
Changed file picker (#5645)
Co-authored-by: WJH <hou32hou@gmail.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Co-authored-by: Pascal Kuthe <pascalkuthe@pm.me>
8 months ago
Skyler Hawthorne f5991657f4
Factor out line ending handling in integration tests (#9921)
Prior to this change, every integration test which wanted its line
endings to be handled transparently across platforms, i.e. test with
the same input that has its platform's line feed characters, converting
the line endings was up to each individual test by calling the
`platform_line` helper function. This significantly increases the amount
of boilerplate one has to copy between all the tests.

However, there are some test cases that need to exert strict control
over the exact input text without being manipulated behind the scenes by
the test framework.

So, with this change, the line feed conversions are factored into
the `TestCase` struct. By default, line endings of the input text
are converted to the platform's native line feed ending, but one can
explicitly specify in their test case when the input text should be left
alone and tested as is.
8 months ago
Shoyu Vanilla 81ae768a4e
Use gix pipeline filter instead of manual crlf implementation (#9503) 10 months ago
dependabot[bot] 49dffa7d24
build(deps): bump gix from 0.55.2 to 0.56.0 (#9055)
* build(deps): bump gix from 0.55.2 to 0.56.0

Bumps [gix](https://github.com/Byron/gitoxide) from 0.55.2 to 0.56.0.
- [Release notes](https://github.com/Byron/gitoxide/releases)
- [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md)
- [Commits](https://github.com/Byron/gitoxide/compare/gix-v0.55.2...gix-v0.56.0)

---
updated-dependencies:
- dependency-name: gix
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Adapt to changes in gix EntryMode/EntryKind

The rest of the gix codebase now calls `.kind()` on the mode and uses
the renamed `EntryKind` enum.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
11 months ago
Michael Davis 7c98b1c829 Fix 'Tree::lookup_entry_by_path' usage 1 year ago
Pascal Kuthe 0cb595e226
transition to nucleo for fuzzy matching (#7814)
* transition to nucleo for fuzzy matching

* drop flakey test case

since the picker streams in results now any test that relies
on the picker containing results is potentially flakely

* use crates.io version of nucleo

* Fix typo in commands.rs

Co-authored-by: Skyler Hawthorne <skyler@dead10ck.com>

---------

Co-authored-by: Skyler Hawthorne <skyler@dead10ck.com>
1 year ago
Pascal Kuthe de0ef8af15
fix UB in diff gutter (#7227) 1 year ago
Pascal Kuthe 77da0ae8ce
downgrade gix log level to info (#6915) 2 years ago
Sebastian Thiel 222be0f1e7
upgrade gitoxide to v0.44 and change repository discovery to worktree-only (#6867) (#6890) 2 years ago
Pascal Kuthe abef92a9b3
log failures in the git integration (#6441) 2 years ago
Dimitar Gyurov 1661e4b5e1
Add a version-control statusline element (#5682) 2 years ago
Pascal Kuthe 48b6aa9a69
Add command for resetting diff hunks (#5736) 2 years ago
Sebastian Thiel ac9e0b39f2 upgrade `git-repository` to `gix` 0.36.1; up min. rustc version to 1.64
This fixes breakage when installing `helix` due to an incorrect usage of
`as_ref()` when interacting with `bstr` in the `gitoxide` codebase.

However, this upgrade also requires a higher rustc version, as `gitoxide`
recently updated its `windows` crate version.
2 years ago
Pascal Kuthe 8a3ec443f1
Fix new clippy lints (#5892) 2 years ago
Pascal Kuthe af532147c9
Add command/keybinding to jump between hunks (#4650)
* add command and keybding to jump to next/prev hunk

* add textobject for change

* Update helix-vcs/src/diff.rs

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

* select entire hunk instead of first char

* fix selection range

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2 years ago
Pascal Kuthe b0f20f13e3
fix git diff when core.autocrlf is enabled (#4995) 2 years ago
Pascal Kuthe 1e31bc3f77
Reduce log message about diff timeout from warn to info (#5012) 2 years ago
Pascal Kuthe 5a3ff74221
Show (git) diff signs in gutter (#3890)
* Show (git) diff signs in gutter (#3890)

Avoid string allocation when git diffing

Incrementally diff using changesets

refactor diffs to be provider indepndent and improve git implementation

remove dependency on zlib-ng

switch to asynchronus diffing with similar

Update helix-vcs/Cargo.toml

fix toml formatting

Co-authored-by: Ivan Tham <pickfire@riseup.net>

fix typo in documentation

use ropey reexpors from helix-core

fix crash when creating new file

remove useless use if io::Cursor

fix spelling mistakes

implement suggested improvement to repository loading

improve git test isolation

remove lefover comments

Co-authored-by: univerz <univerz@fu-solution.com>

fixed spelling mistake

minor cosmetic changes

fix: set self.differ to None if decoding the diff_base fails

fixup formatting

Co-authored-by: Ivan Tham <pickfire@riseup.net>

reload diff_base when file is reloaded from disk

switch to imara-diff

Fixup formatting

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>

Redraw buffer whenever a diff is updated.

Only store hunks instead of changes for individual lines to easily allow
jumping between them

Update to latest gitoxide version

Change default diff gutter position

Only update gutter after timeout

* update diff gutter synchronously, with a timeout

* Apply suggestions from code review

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

* address review comments and ensure lock is always aquired

* remove configuration for redraw timeout

Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2 years ago