aboutsummaryrefslogtreecommitdiff
path: root/helix-term/tests/test
diff options
context:
space:
mode:
authorFrojdholm2022-08-31 16:26:21 +0000
committerGitHub2022-08-31 16:26:21 +0000
commit4c9f144dace484ca99cc84053493ed7b5f6946ac (patch)
tree8bff0da654a9c2ecd33fa1ad7530140a68e0667d /helix-term/tests/test
parente3e71fa36be14659f0eabe1d4c80ef7e68135a6a (diff)
fix: Recalculate completion when going through prompt history (#3193)
* fix: Recalculate completion when going through prompt history * Update completion when the prompt line is changed It should not be possible to update the line without also updating the completion since the completion holds an index into the line. * Fix Prompt::with_line recalculate completion with_line was the last function where recalculate completion had to be done manually. This function now also recalculates the completion so that it's impossible to forget. * Exit selection when recalculating completion Keeping the selection index when the completion has been recalculated doesn't make sense. This clears the selection automatically, removing most needs to manually clear it. * Remove &mut on save_filter Co-authored-by: Blaž Hrastnik <blaz@mxxn.io>
Diffstat (limited to 'helix-term/tests/test')
-rw-r--r--helix-term/tests/test/prompt.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/helix-term/tests/test/prompt.rs b/helix-term/tests/test/prompt.rs
new file mode 100644
index 00000000..2ab9604c
--- /dev/null
+++ b/helix-term/tests/test/prompt.rs
@@ -0,0 +1,18 @@
+use super::*;
+
+use helix_term::application::Application;
+
+#[tokio::test]
+async fn test_history_completion() -> anyhow::Result<()> {
+ test_key_sequence(
+ &mut Application::new(Args::default(), Config::default())?,
+ Some(":asdf<ret>:theme d<C-n><tab>"),
+ Some(&|app| {
+ assert!(!app.editor.is_err());
+ }),
+ false,
+ )
+ .await?;
+
+ Ok(())
+}