diff --git a/helix-term/tests/test/commands.rs b/helix-term/tests/test/commands.rs index 2af1a054f..86ca6e68b 100644 --- a/helix-term/tests/test/commands.rs +++ b/helix-term/tests/test/commands.rs @@ -653,6 +653,141 @@ async fn test_join_selections_space() -> anyhow::Result<()> { Ok(()) } +#[tokio::test(flavor = "multi_thread")] +async fn test_injected_comments() -> anyhow::Result<()> { + // Uncomment inner injection + test(( + indoc! {r#"\ +
C-c on this line should use the HTML comment token(s).
+ + "#}, + ":lang htmlC-c on this line should use the HTML comment token(s).
+ + "#}, + )) + .await?; + + // Comment inner injection + test(( + indoc! {r#"\ +C-c on this line should use the HTML comment token(s).
+ + "#}, + ":lang htmlC-c on this line should use the HTML comment token(s).
+ + "#}, + )) + .await?; + + // Comments two different injection layers with different comments + test(( + indoc! {r#"\ +C-c #[|on this line ]#should use the HTML comment token(s).
+ + "#}, + ":lang htmlC-c #[|on this line ]#should use the HTML comment token(s).
+ + "#}, + )) + .await?; + + // Works with multiple selections + test(( + indoc! {r#"\ +C-c #(|on this line )#should use the HTML comment token(s).
+ + "#}, + ":lang htmlC-c #(|on this line)# should use the HTML comment token(s).
+ + "#}, + )) + .await?; + + Ok(()) +} + #[tokio::test(flavor = "multi_thread")] async fn test_join_selections_comment() -> anyhow::Result<()> { test(( diff --git a/lol.html b/lol.html index 516ea19a9..0e60e6725 100644 --- a/lol.html +++ b/lol.html @@ -1,5 +1,10 @@ -C-c on this line should use the HTML comment token(s).
+