Misc improvements
This commit is contained in:
@@ -412,6 +412,30 @@ void OnCommand(Event event) {
|
||||
IF_DEBUG(AssertRanges(active.view->carets));
|
||||
}
|
||||
|
||||
void EvalCommand(String command) {
|
||||
BSet active = GetBSet(ActiveWindowID);
|
||||
For (active.view->hooks) {
|
||||
if (it.name == command) {
|
||||
ProfileScopeEx(it.name);
|
||||
it.function();
|
||||
return;
|
||||
}
|
||||
}
|
||||
For (CommandFunctions) {
|
||||
if (it.name == command) {
|
||||
ProfileScopeEx(it.name);
|
||||
it.function();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void EvalCommand(String16 command) {
|
||||
Scratch scratch;
|
||||
EvalCommand(ToString(scratch, command));
|
||||
}
|
||||
|
||||
|
||||
void GarbageCollect() {
|
||||
if (RunGCThisFrame == false) {
|
||||
return;
|
||||
@@ -787,7 +811,7 @@ int main(int argc, char **argv)
|
||||
|
||||
For (CommandFunctions) {
|
||||
if (it.binding.len != 0) {
|
||||
it.trigger = ParseKey(Perm, it.binding, it.name.data);
|
||||
it.trigger = ParseKeyCached(it.binding);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user