editor: Allow clicking on excerpts with alt key to open file path (#42235)
#42021 Made clicking on an excerpt title toggle it. This PR brings back the old behavior if a user is pressing the Alt key when clicking on an excerpt title. Release Notes: - N/A --------- Co-authored-by: Remco Smits <djsmits12@gmail.com>
This commit is contained in:
co-authored by
Remco Smits
parent
0881e548de
commit
309947aa53
@@ -4093,7 +4093,17 @@ impl EditorElement {
|
||||
.on_mouse_down(MouseButton::Left, |_, _, cx| cx.stop_propagation())
|
||||
.on_click(window.listener_for(&self.editor, {
|
||||
let buffer_id = for_excerpt.buffer_id;
|
||||
move |editor, _e: &ClickEvent, _window, cx| {
|
||||
move |editor, e: &ClickEvent, window, cx| {
|
||||
if e.modifiers().alt {
|
||||
editor.open_excerpts_common(
|
||||
Some(jump_data.clone()),
|
||||
e.modifiers().secondary(),
|
||||
window,
|
||||
cx,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if is_folded {
|
||||
editor.unfold_buffer(buffer_id, cx);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user