Rename to Config, Fix slowness of ShowCommands and improve quality

This commit is contained in:
krzosa
2025-12-21 22:26:15 +01:00
parent 79d709d391
commit 725cdde007
10 changed files with 46 additions and 33 deletions

View File

@@ -33,7 +33,7 @@
#include "process.cpp"
#include "event.cpp"
#include "parser.cpp"
#include "config.cpp"
#include "commands.cpp"
#include "commands_clipboard.cpp"
@@ -392,7 +392,10 @@ void OnCommand(Event event) {
For (CommandFunctions) {
if (it.trigger && MatchEvent(it.trigger, &event)) {
double start = GetTimeSeconds();
it.function();
ReportConsolef("%S: %f", it.name, GetTimeSeconds() - start);
LastExecutedCommand = it.function;
}
}
@@ -520,7 +523,7 @@ void Windows_SetupVCVarsall(mco_coro *co) {
Scratch scratch;
String working_dir = WorkDir;
String buffer_name = GetUniqueBufferName(working_dir, "vcvarsall-");
String cmd = Format(scratch, "\"%S\" && set", StyleVCVarsall);
String cmd = Format(scratch, "\"%S\" && set", ConfigVCVarsall);
view = ExecHidden(buffer_name, cmd, working_dir);
}
for (;;) {
@@ -568,7 +571,7 @@ void MainLoop() {
Update(it);
}
WaitForEvents = StyleWaitForEvents;
WaitForEvents = ConfigWaitForEvents;
if (IsDocumentSelectionValid() || IsScrollbarSelectionValid() || ActiveProcesses.len) {
WaitForEvents = false;
}
@@ -710,7 +713,7 @@ int main(int argc, char **argv)
InitBuffers();
InitRender();
ReloadFont(StyleFont, (U32)StyleFontSize);
ReloadFont(ConfigFont, (U32)ConfigFontSize);
InitWindows();
InitOS(ReportWarningf);