git: Fix project diff shortcuts (#26045)
Release Notes: - git: Fix keyboard shortcut display in project diff view
This commit is contained in:
parent
ad94642e83
commit
85211889e5
16 changed files with 108 additions and 233 deletions
|
@ -42,6 +42,7 @@ use gpui::{
|
|||
SharedString, Size, StatefulInteractiveElement, Style, Styled, Subscription, TextRun,
|
||||
TextStyleRefinement, Window,
|
||||
};
|
||||
use inline_completion::Direction;
|
||||
use itertools::Itertools;
|
||||
use language::{
|
||||
language_settings::{
|
||||
|
@ -8906,7 +8907,7 @@ fn diff_hunk_controls(
|
|||
move |window, cx| {
|
||||
Tooltip::for_action_in(
|
||||
"Next Hunk",
|
||||
&GoToHunk::default(),
|
||||
&GoToHunk,
|
||||
&focus_handle,
|
||||
window,
|
||||
cx,
|
||||
|
@ -8921,7 +8922,11 @@ fn diff_hunk_controls(
|
|||
let position =
|
||||
hunk_range.end.to_point(&snapshot.buffer_snapshot);
|
||||
editor.go_to_hunk_after_or_before_position(
|
||||
&snapshot, position, true, true, window, cx,
|
||||
&snapshot,
|
||||
position,
|
||||
Direction::Next,
|
||||
window,
|
||||
cx,
|
||||
);
|
||||
editor.expand_selected_diff_hunks(cx);
|
||||
});
|
||||
|
@ -8938,7 +8943,7 @@ fn diff_hunk_controls(
|
|||
move |window, cx| {
|
||||
Tooltip::for_action_in(
|
||||
"Previous Hunk",
|
||||
&GoToPreviousHunk::default(),
|
||||
&GoToPreviousHunk,
|
||||
&focus_handle,
|
||||
window,
|
||||
cx,
|
||||
|
@ -8953,7 +8958,11 @@ fn diff_hunk_controls(
|
|||
let point =
|
||||
hunk_range.start.to_point(&snapshot.buffer_snapshot);
|
||||
editor.go_to_hunk_after_or_before_position(
|
||||
&snapshot, point, false, true, window, cx,
|
||||
&snapshot,
|
||||
point,
|
||||
Direction::Prev,
|
||||
window,
|
||||
cx,
|
||||
);
|
||||
editor.expand_selected_diff_hunks(cx);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue