Marshall Bowers
a109396316
Fix GitHub commit permalinks ( #9961 )
...
This PR fixes an issue where GitHub commit permalinks were being
constructed with the wrong URL segment.
This would result in clicking on a commit from the Git blame view taking
you to the wrong page on GitHub.
### Before
```
https://github.com/zed-industries/zed/commits/a3d985028ccce085e4f5a06694835cd9b3296dba
```
<img width="1654" alt="Screenshot 2024-03-29 at 12 59 51 PM"
src="https://github.com/zed-industries/zed/assets/1486634/122fd678-de56-42cb-a0c5-1ce1b9b104b5 ">
### After
```
https://github.com/zed-industries/zed/commit/a3d985028ccce085e4f5a06694835cd9b3296dba
```
<img width="1654" alt="Screenshot 2024-03-29 at 12 59 56 PM"
src="https://github.com/zed-industries/zed/assets/1486634/1c92b2ef-7925-46bc-aebf-b739be1eae74 ">
Release Notes:
- N/A
2024-03-29 13:17:48 -04:00
bd3752ffd2
Add git blame ( #8889 )
...
This adds a new action to the editor: `editor: toggle git blame`. When
used it turns on a sidebar containing `git blame` information for the
currently open buffer.
The git blame information is updated when the buffer changes. It handles
additions, deletions, modifications, changes to the underlying git data
(new commits, changed commits, ...), file saves. It also handles folding
and wrapping lines correctly.
When the user hovers over a commit, a tooltip displays information for
the commit that introduced the line. If the repository has a remote with
the name `origin` configured, then clicking on a blame entry opens the
permalink to the commit on the code host.
Users can right-click on a blame entry to get a context menu which
allows them to copy the SHA of the commit.
The feature also works on shared projects, e.g. when collaborating a
peer can request `git blame` data.
As of this PR, Zed now comes bundled with a `git` binary so that users
don't have to have `git` installed locally to use this feature.
### Screenshots



### TODOs
- [x] Bundling `git` binary
### Release Notes
Release Notes:
- Added `editor: toggle git blame` command that toggles a sidebar with
git blame information for the current buffer.
---------
Co-authored-by: Antonio <antonio@zed.dev >
Co-authored-by: Piotr <piotr@zed.dev >
Co-authored-by: Bennet <bennetbo@gmx.de >
Co-authored-by: Mikayla <mikayla@zed.dev >
2024-03-28 18:32:11 +01:00
Kirill Bulatov
79146926f0
Properly display deleted diff hunks ( #9182 )
...
Follow-up of https://github.com/zed-industries/zed/pull/9068
Release Notes:
- Fixed removal diff hunks not being displayed properly in the editor
2024-03-11 17:53:45 +02:00
Kirill Bulatov
d60d8d08da
Add editor::RevertSelectedHunks to revert git diff hunks in the editor ( #9068 )
...
https://github.com/zed-industries/zed/assets/2690773/653b5658-e3f3-4aee-9a9d-0f2153b4141b
Release Notes:
- Added `editor::RevertSelectedHunks` (`cmd-alt-z` by default) for
reverting git hunks from the editor
2024-03-09 01:37:24 +02:00
Marshall Bowers
2f3f7cccdd
Enable clippy::needless_lifetimes ( #8777 )
...
This PR enables the
[`clippy::needless_lifetimes`](https://rust-lang.github.io/rust-clippy/master/index.html#/needless_lifetimes )
rule and fixes the outstanding violations.
Release Notes:
- N/A
2024-03-03 11:52:58 -05:00
Piotr Osiewicz
204fbd7a79
text: Wrap BufferId into a newtype
2024-01-29 20:00:47 +01:00
Piotr Osiewicz
a8f1c15a1e
chore: Fix clippy::needless_borrow up to an editor
2024-01-21 15:03:24 +01:00
Julia
a3bc3f85a9
Clean up final remaining code paths calling old diff update method
2023-05-25 14:41:09 -04:00
Mikayla Maki and max
b9fb1b649a
Make scrollbar content detection cheaper
...
Remove scrollbars from multibuffers
co-authored-by: max <max@zed.dev >
2023-05-22 10:55:44 -07:00
Mikayla Maki
b72cdb7362
Refactored apart the forward and the backwards iterator for diff hunks
2023-05-19 18:09:47 -07:00
Mikayla Maki and max
c9a3283048
refine batched anchor conversions
...
co-authored-by: max <max@zed.dev >
2023-05-19 16:52:57 -07:00
Mikayla Maki
3c35f275b4
Batch anchor conversions in git hunk iterator
2023-05-19 16:23:45 -07:00
Julia and Max Brunsfeld
48c0db49da
Rewrite multi-buffer aware git hunks in range to be more correct
...
Less ad-hoc state tracking, rely more on values provided by the
underlying data
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2022-12-15 17:09:09 -05:00
Julia
c0c47139aa
Get tests building again
2022-12-15 00:17:28 -05:00
Julia
4c2ee3d972
Cleanup
2022-12-13 12:35:58 -05:00
Julia
d100acd3b1
Initial hacky displaying of git gutter in multi-buffers
2022-12-13 12:35:58 -05:00
Julia
bc601527b8
Layout git gutters inclusively
2022-10-31 14:35:42 -04:00
Julia and Kay Simmons
412c77460e
Add action to go to next/previous git diff in editor
...
Co-Authored-By: Kay Simmons <kay@zed.dev >
2022-10-28 15:08:13 -04:00
Julia
a2e05e3a47
Merge pull request #1768 from zed-industries/git-gutter-meets-code-folding
...
Git gutter meets code folding (and word wrap fixes)
2022-10-17 14:51:47 -04:00
Julia
7ab8f55c11
Include deletion hunks in fold regardless of end
2022-10-13 00:42:53 -04:00
Max Brunsfeld
a2c9a67558
Re-export basic text types from text and language crates
...
Also avoid production dependencies on fs and rope in collab
2022-10-12 15:48:19 -07:00
Mikayla Maki
a9ce687031
Finished refactoring out fs and rope
2022-10-11 15:25:54 -07:00
Mikayla Maki
9bdb8d31c0
Moved fs to it's own crate, build failing due to cyclic dependency on rope
2022-10-11 13:03:36 -07:00
Julia and Joseph Lyons
9905d9833c
Reset buffer git diff when setting diff base to None
...
Co-Authored-By: Joseph Lyons <joseph@zed.dev >
2022-10-07 15:37:37 -04:00
Julia
981253213d
Reload git index on file events to catch new contents
2022-10-06 12:01:21 -04:00
Mikayla Maki
bb80bd45bf
Removed debugs, simplified settings
2022-10-03 17:43:05 -07:00
Mikayla Maki
b49d0e782c
Fixed a couple bugs in tests and worktree path handling
2022-10-03 17:18:38 -07:00
Julia and Mikayla Maki
0615592f81
Rename head text to indicate that it's not always going to be from head
...
Co-Authored-By: Mikayla Maki <mikayla@zed.dev >
2022-10-03 15:11:06 -04:00
Mikayla Maki
da143ae46a
made git diff rendering respect line wrap
2022-10-02 18:00:13 -07:00
d2ac8018bb
Refactored git repository code to seperate out repository entry tracking data and git2 mocking code.
...
Co-authored-by: Max <max@zed.dev >
Co-authored-by: Julia <julia@zed.dev >
2022-09-30 17:33:34 -07:00
c15e29be64
WIP Start refactoring separation of concerns for repo metadata
...
Co-Authored-By: Max Brunsfeld <max@zed.dev >
Co-Authored-By: Mikayla Maki <mikayla@zed.dev >
2022-09-30 18:25:25 -04:00
484bdb0fc0
Start a test for remote git data updating
...
Co-Authored-By: Mikayla Maki <mikayla@zed.dev >
Co-Authored-By: Max Brunsfeld <max@zed.dev >
2022-09-30 15:51:32 -04:00
Julia
af5b1c1e3e
Fix some panics in tests
2022-09-30 13:51:54 -04:00
19cd0dedb9
Use sumtree instead of iterator linear search for diff hunks in range
...
Co-Authored-By: Max Brunsfeld <max@zed.dev >
Co-Authored-By: Mikayla Maki <mikayla@zed.dev >
2022-09-30 13:32:54 -04:00
Julia
d1a7dc02a2
Track index instead of head for diffs
2022-09-29 13:16:02 -04:00
Mikayla Maki
ab3f820edc
WIP, re-doing fs and fake git repos
2022-09-29 13:16:02 -04:00
Julia and Mikayla Maki
1da2b63b97
Move git related things into specialized git crate
...
Co-Authored-By: Mikayla Maki <mikayla@zed.dev >
2022-09-29 13:16:02 -04:00