Allow tab and shift-tab completion in path editing

This commit is contained in:
Jeremy Soller 2026-01-07 08:44:50 -07:00 • committed by Ashley Wulber
parent a47410ecfe
commit 3b49808bc6

View file

@ -1642,6 +1642,7 @@ pub enum Message {
EditLocationComplete(usize), EditLocationComplete(usize),
EditLocationEnable, EditLocationEnable,
EditLocationSubmit, EditLocationSubmit,
EditLocationTab,
OpenInNewTab(PathBuf), OpenInNewTab(PathBuf),
EmptyTrash, EmptyTrash,
#[cfg(feature = "desktop")] #[cfg(feature = "desktop")]
@ -3494,6 +3495,11 @@ impl Tab {
cd = edit_location.resolve(); cd = edit_location.resolve();
} }
} }
Message::EditLocationTab => {
if let Some(edit_location) = &mut self.edit_location {
edit_location.select(!modifiers.contains(Modifiers::SHIFT));
}
}
Message::OpenInNewTab(path) => { Message::OpenInNewTab(path) => {
commands.push(Command::OpenInNewTab(path)); commands.push(Command::OpenInNewTab(path));
} }
@ -4737,6 +4743,7 @@ impl Tab {
)) ))
}) })
.on_submit(|_| Message::EditLocationSubmit) .on_submit(|_| Message::EditLocationSubmit)
.on_tab(Message::EditLocationTab)
.line_height(1.0), .line_height(1.0),
); );
} }