aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
authorJoe2022-09-20 07:40:48 +0000
committerGitHub2022-09-20 07:40:48 +0000
commitaa00a470f31514b792e219513ffb3806a5e5b53e (patch)
tree9c2fd83d566e4e35c3f375b6b832f0adb79b5452 /helix-term/src/commands
parent1df32c917c8a386947063403577098d1277380c7 (diff)
Fix preview bug (#3644)
* Fix preview bug * Add comment to empty case
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/typed.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index c22f8712..f49fff30 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -715,7 +715,10 @@ fn theme(
cx.editor.unset_theme_preview();
}
PromptEvent::Update => {
- if let Some(theme_name) = args.first() {
+ if args.is_empty() {
+ // Ensures that a preview theme gets cleaned up if the user backspaces until the prompt 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");