diff options
author | Graic | 2022-10-12 13:34:35 +0000 |
---|---|---|
committer | GitHub | 2022-10-12 13:34:35 +0000 |
commit | 68909dcef46c7b68f1a92cdc7fd04eb89549b6fb (patch) | |
tree | 5c7ee95e3f7f56006d7435907823d40cb89bbbd6 /helix-term/tests | |
parent | c54a0363bb59300290efa8ba86e291d94f938673 (diff) |
Fix append cursor location when selection anchor is at end of document (#4147)
Diffstat (limited to 'helix-term/tests')
-rw-r--r-- | helix-term/tests/test/movement.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/helix-term/tests/test/movement.rs b/helix-term/tests/test/movement.rs index e5abb0b0..45aae39e 100644 --- a/helix-term/tests/test/movement.rs +++ b/helix-term/tests/test/movement.rs @@ -87,6 +87,27 @@ async fn cursor_position_newly_opened_file() -> anyhow::Result<()> { } #[tokio::test] +async fn cursor_position_append_eof() -> anyhow::Result<()> { + // Selection is fowards + test(( + "#[foo|]#", + "abar<esc>", + helpers::platform_line("#[foobar|]#\n").as_ref(), + )) + .await?; + + // Selection is backwards + test(( + "#[|foo]#", + "abar<esc>", + helpers::platform_line("#[foobar|]#\n").as_ref(), + )) + .await?; + + Ok(()) +} + +#[tokio::test] async fn select_mode_tree_sitter_next_function_is_union_of_objects() -> anyhow::Result<()> { test_with_config( Args { |