Fix ctrl-shift-f and AddCommand bugs

This commit is contained in:
Krzosa Karol
2026-01-16 23:15:23 +01:00
parent 663286b45c
commit 270109a56b
2 changed files with 8 additions and 2 deletions

View File

@@ -536,6 +536,12 @@ void CMD_KillProcess() {
} RegisterCommand(CMD_KillProcess, "", "Kill process in the last active primary window"); } RegisterCommand(CMD_KillProcess, "", "Kill process in the last active primary window");
void AddCommand(Array<Command> *arr, String name, String binding, CMDFunction *function) { void AddCommand(Array<Command> *arr, String name, String binding, CMDFunction *function) {
IterRemove(*arr) {
IterRemovePrepare(*arr);
if (it.name == name) {
remove_item = true;
}
}
Command cmd = {}; Command cmd = {};
cmd.name = name; cmd.name = name;
cmd.binding = binding; cmd.binding = binding;

View File

@@ -91,9 +91,9 @@ void CMD_SearchOpenBuffers() {
Open(string); Open(string);
}); });
view->update_hook = UpdateSearchOpenBuffersView; view->update_hook = UpdateSearchOpenBuffersView;
SelectRange(view, GetLineRangeWithoutNL(search_project_buffer, 0));
if (string.len) { if (string.len) {
SelectRange(view, GetLineRangeWithoutNL(search_project_buffer, 0));
Replace(view, string); Replace(view, string);
SelectEntireBuffer(view);
} }
SelectRange(view, GetLineRangeWithoutNL(search_project_buffer, 0));
} RegisterCommand(CMD_SearchOpenBuffers, "ctrl-shift-f", "Interactive search over the entire project in a new buffer view"); } RegisterCommand(CMD_SearchOpenBuffers, "ctrl-shift-f", "Interactive search over the entire project in a new buffer view");