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:
@@ -817,6 +817,14 @@ cmd_refresh(CommandContext &ctx)
|
||||
ctx.editor.SetStatus("Find canceled");
|
||||
return true;
|
||||
}
|
||||
// If nothing else to cancel, treat C-g/refresh as a mark clear (ke behavior).
|
||||
if (Buffer *buf = ctx.editor.CurrentBuffer()) {
|
||||
if (buf->MarkSet()) {
|
||||
buf->ClearMark();
|
||||
ctx.editor.SetStatus("Mark cleared");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// Otherwise just a hint; renderer will redraw
|
||||
ctx.editor.SetStatus("");
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user