-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Theme preview doesn't return theme to normal when navigating command history #3620
Comments
I can make the following changes in a PR, but the gist of it is we need to:
helix/helix-term/src/ui/prompt.rs Lines 564 to 575 in ec28b2b
to: ctrl!('p') | key!(Up) => {
if let Some(register) = self.history_register {
(self.callback_fn)(cx, &self.line, PromptEvent::Abort);
let register = cx.editor.registers.get_mut(register);
self.change_history(register.read(), CompletionDirection::Backward);
(self.callback_fn)(cx, &self.line, PromptEvent::Update);
}
}
ctrl!('n') | key!(Down) => {
if let Some(register) = self.history_register {
(self.callback_fn)(cx, &self.line, PromptEvent::Abort);
let register = cx.editor.registers.get_mut(register);
self.change_history(register.read(), CompletionDirection::Forward);
(self.callback_fn)(cx, &self.line, PromptEvent::Update);
}
}
helix/helix-term/src/ui/prompt.rs Lines 590 to 615 in ec28b2b
Unrelated to the issue above but discovered along the way: The preview isn't rolled back if you hold backspace and then enter a new command. eg.
This requires a change in this part: helix/helix-term/src/commands/typed.rs Lines 717 to 726 in ec28b2b
to: PromptEvent::Update => {
if args.is_empty() {
cx.editor.unset_theme_preview();
} else if let Some(theme_name) = args.first() {
if let Ok(theme) = cx.editor.theme_loader.load(theme_name) {
if !(true_color || theme.is_16_color()) {
bail!("Unsupported theme: theme requires true color support");
}
cx.editor.set_theme_preview(theme);
};
};
} |
Summary
The theme preview when using
:theme
will keep the previewed theme if you switch away from the command using history navigation.Reproduction Steps
:theme
command, such as:abc<ret>
.:theme
and hover the completion over a theme other than the currently selected one, thus previewing it.<esc>
, exiting the command prompt.The previewed theme will persist after the command is switched away from using the up arrow key.
Helix log
Nothing relevant
Platform
MacOS
Terminal Emulator
iTerm2 v3.4.16
Helix Version
Helix 22.08
The text was updated successfully, but these errors were encountered: