Add mark-clearing behavior to refresh command and related test.

- Updated `Refresh` command to clear the mark when no active prompt, search, or visual-line mode is present.
- Added a new unit test verifying mark-clearing behavior for `Ctrl-G` (mapped to `Refresh`).
- Bumped version to 1.6.3 in `CMakeLists.txt`.
This commit is contained in:
2026-02-14 23:05:44 -08:00
parent 2a6ff2a862
commit 44827fe53f
3 changed files with 28 additions and 1 deletions

View File

@@ -59,6 +59,25 @@ TEST (CommandSemantics_ToggleMark_JumpToMark)
}
TEST (CommandSemantics_CtrlGRefresh_ClearsMark_WhenNothingElseToCancel)
{
TestHarness h;
Buffer &b = h.Buf();
b.insert_text(0, 0, std::string("hello"));
b.SetCursor(2, 0);
ASSERT_EQ(b.MarkSet(), false);
ASSERT_TRUE(h.Exec(CommandId::ToggleMark));
ASSERT_EQ(b.MarkSet(), true);
// C-g is mapped to Refresh; when there's no prompt/search/visual-line mode to cancel,
// it should clear the mark.
ASSERT_TRUE(h.Exec(CommandId::Refresh));
ASSERT_EQ(b.MarkSet(), false);
}
TEST (CommandSemantics_CopyRegion_And_KillRegion)
{
TestHarness h;