NextActiveWindowID to fix the bug where ctrl+q would trigger for 2 registered commands and it would work on 2 different active windows

This commit is contained in:
Krzosa Karol
2025-12-27 12:46:46 +01:00
parent 9ae73e5c04
commit b6f3a1ebec
5 changed files with 38 additions and 38 deletions

View File

@@ -111,7 +111,7 @@ void CommandWindowUpdate() {
void Command_ShowCommands() {
if (ActiveWindowID == CommandWindowID && LastExecutedCommand == Command_ShowCommands) {
ActiveWindowID = LastActiveLayoutWindowID;
NextActiveWindowID = LastActiveLayoutWindowID;
return;
}
ProfileFunction();
@@ -119,7 +119,7 @@ void Command_ShowCommands() {
BSet command_bar = GetBSet(CommandWindowID);
command_bar.window->visible = true;
command_bar.window->eval_command = true;
ActiveWindowID = command_bar.window->id;
NextActiveWindowID = command_bar.window->id;
ResetBuffer(command_bar.buffer);
For(CommandFunctions) {
RawAppendf(command_bar.buffer, "\n%S", it.name);
@@ -130,7 +130,7 @@ void Command_ShowCommands() {
void Command_ShowDebugBufferList() {
if (ActiveWindowID == CommandWindowID && LastExecutedCommand == Command_ShowDebugBufferList) {
ActiveWindowID = LastActiveLayoutWindowID;
NextActiveWindowID = LastActiveLayoutWindowID;
return;
}
ProfileFunction();
@@ -138,7 +138,7 @@ void Command_ShowDebugBufferList() {
BSet command_bar = GetBSet(CommandWindowID);
command_bar.window->visible = true;
command_bar.window->eval_command = false;
ActiveWindowID = command_bar.window->id;
NextActiveWindowID = command_bar.window->id;
ResetBuffer(command_bar.buffer);
For (Buffers) {
RawAppendf(command_bar.buffer, "\n%S", it->name);
@@ -149,7 +149,7 @@ void Command_ShowDebugBufferList() {
void Command_ShowBufferList() {
if (ActiveWindowID == CommandWindowID && LastExecutedCommand == Command_ShowBufferList) {
ActiveWindowID = LastActiveLayoutWindowID;
NextActiveWindowID = LastActiveLayoutWindowID;
return;
}
ProfileFunction();
@@ -157,7 +157,7 @@ void Command_ShowBufferList() {
BSet command_bar = GetBSet(CommandWindowID);
command_bar.window->visible = true;
command_bar.window->eval_command = false;
ActiveWindowID = command_bar.window->id;
NextActiveWindowID = command_bar.window->id;
ResetBuffer(command_bar.buffer);
For (Buffers) {
if (it->special || it->garbage || it->is_dir) {
@@ -202,7 +202,7 @@ void OpenCommand(BSet active) {
}
if (active.window->eval_command) {
BSet main = GetBSet(LastActiveLayoutWindowID);
ActiveWindowID = main.window->id;
NextActiveWindowID = main.window->id;
EvalCommand(string);
} else {
Open(string);