New UI buffer thing
This commit is contained in:
@@ -110,7 +110,7 @@ void CommandWindowUpdate() {
|
||||
}
|
||||
|
||||
void Command_ShowCommands() {
|
||||
if (ActiveWindowID == CommandWindowID && LastExecutedCommand == Command_ShowCommands) {
|
||||
if (ActiveWindowID == CommandWindowID && LastExecutedManualCommand == Command_ShowCommands) {
|
||||
NextActiveWindowID = LastActiveLayoutWindowID;
|
||||
return;
|
||||
}
|
||||
@@ -118,18 +118,20 @@ void Command_ShowCommands() {
|
||||
|
||||
BSet command_bar = GetBSet(CommandWindowID);
|
||||
command_bar.window->visible = true;
|
||||
command_bar.window->eval_command = true;
|
||||
NextActiveWindowID = command_bar.window->id;
|
||||
ResetBuffer(command_bar.buffer);
|
||||
For(CommandFunctions) {
|
||||
RawAppendf(command_bar.buffer, "\n%S", it.name);
|
||||
For (CommandFunctions) {
|
||||
if (it.name == "OpenCommand") {
|
||||
continue;
|
||||
}
|
||||
RawAppendf(command_bar.buffer, "\n:%S", it.name);
|
||||
}
|
||||
command_bar.view->update_scroll = true;
|
||||
SelectRange(command_bar.view, GetBufferBeginAsRange(command_bar.buffer));
|
||||
} RegisterCommand(Command_ShowCommands, "ctrl-shift-p");
|
||||
|
||||
void Command_ShowDebugBufferList() {
|
||||
if (ActiveWindowID == CommandWindowID && LastExecutedCommand == Command_ShowDebugBufferList) {
|
||||
if (ActiveWindowID == CommandWindowID && LastExecutedManualCommand == Command_ShowDebugBufferList) {
|
||||
NextActiveWindowID = LastActiveLayoutWindowID;
|
||||
return;
|
||||
}
|
||||
@@ -137,7 +139,6 @@ void Command_ShowDebugBufferList() {
|
||||
|
||||
BSet command_bar = GetBSet(CommandWindowID);
|
||||
command_bar.window->visible = true;
|
||||
command_bar.window->eval_command = false;
|
||||
NextActiveWindowID = command_bar.window->id;
|
||||
ResetBuffer(command_bar.buffer);
|
||||
For (Buffers) {
|
||||
@@ -148,7 +149,7 @@ void Command_ShowDebugBufferList() {
|
||||
} RegisterCommand(Command_ShowDebugBufferList, "");
|
||||
|
||||
void Command_ShowBufferList() {
|
||||
if (ActiveWindowID == CommandWindowID && LastExecutedCommand == Command_ShowBufferList) {
|
||||
if (ActiveWindowID == CommandWindowID && LastExecutedManualCommand == Command_ShowBufferList) {
|
||||
NextActiveWindowID = LastActiveLayoutWindowID;
|
||||
return;
|
||||
}
|
||||
@@ -156,7 +157,6 @@ void Command_ShowBufferList() {
|
||||
|
||||
BSet command_bar = GetBSet(CommandWindowID);
|
||||
command_bar.window->visible = true;
|
||||
command_bar.window->eval_command = false;
|
||||
NextActiveWindowID = command_bar.window->id;
|
||||
ResetBuffer(command_bar.buffer);
|
||||
For (Buffers) {
|
||||
@@ -178,20 +178,10 @@ void OpenCommand(BSet active) {
|
||||
if (line == 0) {
|
||||
line = ClampTop(1ll, active.buffer->line_starts.len - 1ll);
|
||||
}
|
||||
|
||||
string = GetLineStringWithoutNL(active.buffer, line);
|
||||
Int idx = 0;
|
||||
if (Seek(string, u"||", &idx)) {
|
||||
string = Skip(string, idx + 3);
|
||||
}
|
||||
}
|
||||
if (active.window->eval_command) {
|
||||
BSet main = GetBSet(LastActiveLayoutWindowID);
|
||||
NextActiveWindowID = main.window->id;
|
||||
EvalCommand(string);
|
||||
} else {
|
||||
Open(string);
|
||||
}
|
||||
|
||||
Open(string);
|
||||
}
|
||||
|
||||
void Command_OpenCommand() {
|
||||
@@ -199,5 +189,7 @@ void Command_OpenCommand() {
|
||||
return;
|
||||
}
|
||||
BSet active = GetBSet(ActiveWindowID);
|
||||
BSet main = GetBSet(LastActiveLayoutWindowID);
|
||||
NextActiveWindowID = main.window->id;
|
||||
OpenCommand(active);
|
||||
} RegisterCommand(Command_OpenCommand, "ctrl-q | enter");
|
||||
} RegisterCommand(Command_OpenCommand, "ctrl-q | enter");
|
||||
|
||||
Reference in New Issue
Block a user