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:
Anthony Eid 2025-11-07 16:23:55 -05:00 committed by GitHub
parent 0881e548de
commit 309947aa53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {