RemedyBG integration plugin
This commit is contained in:
@@ -1112,6 +1112,12 @@ String Coro_CloseAllEx(mco_coro *co) {
|
|||||||
void Coro_Quit(mco_coro *co) {
|
void Coro_Quit(mco_coro *co) {
|
||||||
String res = Coro_CloseAllEx(co);
|
String res = Coro_CloseAllEx(co);
|
||||||
if (res != "Cancel") {
|
if (res != "Cancel") {
|
||||||
|
For (GlobalHooks) {
|
||||||
|
if (it.kind == HookKind_AppQuit) {
|
||||||
|
ProfileScopeEx(it.name);
|
||||||
|
it.function({});
|
||||||
|
}
|
||||||
|
}
|
||||||
AppIsRunning = false;
|
AppIsRunning = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1120,9 +1126,15 @@ void CMD_Quit(HookParam param) {
|
|||||||
CoRemove("Coro_Quit");
|
CoRemove("Coro_Quit");
|
||||||
CoData *data = CoAdd(Coro_Quit);
|
CoData *data = CoAdd(Coro_Quit);
|
||||||
CoResume(data);
|
CoResume(data);
|
||||||
} RegisterHook(CMD_Quit, HookKind_AppQuit, "", "Ask user which files he would like to save and exit");
|
} RegisterCommand(CMD_Quit, "", "Ask user which files he would like to save and exit");
|
||||||
|
|
||||||
void CMD_QuitWithoutSaving(HookParam param) {
|
void CMD_QuitWithoutSaving(HookParam param) {
|
||||||
|
For (GlobalHooks) {
|
||||||
|
if (it.kind == HookKind_AppQuit) {
|
||||||
|
ProfileScopeEx(it.name);
|
||||||
|
it.function({});
|
||||||
|
}
|
||||||
|
}
|
||||||
AppIsRunning = false;
|
AppIsRunning = false;
|
||||||
} RegisterCommand(CMD_QuitWithoutSaving, "", "Self explanatory");
|
} RegisterCommand(CMD_QuitWithoutSaving, "", "Self explanatory");
|
||||||
|
|
||||||
|
|||||||
2249
src/text_editor/remedybg_plugin.cpp
Normal file
2249
src/text_editor/remedybg_plugin.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -34,6 +34,8 @@
|
|||||||
#include "draw.cpp"
|
#include "draw.cpp"
|
||||||
#include "test/tests.cpp"
|
#include "test/tests.cpp"
|
||||||
|
|
||||||
|
#include "remedybg_plugin.cpp"
|
||||||
|
|
||||||
#if OS_WASM
|
#if OS_WASM
|
||||||
EM_JS(void, JS_SetMouseCursor, (const char *cursor_str), {
|
EM_JS(void, JS_SetMouseCursor, (const char *cursor_str), {
|
||||||
document.getElementById("canvas").style.cursor = UTF8ToString(cursor_str);
|
document.getElementById("canvas").style.cursor = UTF8ToString(cursor_str);
|
||||||
@@ -425,12 +427,7 @@ void OnCommand(Event event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (event.kind == EVENT_QUIT) {
|
if (event.kind == EVENT_QUIT) {
|
||||||
For (GlobalHooks) {
|
CMD_Quit({});
|
||||||
if (it.kind == HookKind_AppQuit) {
|
|
||||||
ProfileScopeEx(it.name);
|
|
||||||
it.function({});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IF_DEBUG(AssertRanges(main.view->carets));
|
IF_DEBUG(AssertRanges(main.view->carets));
|
||||||
|
|||||||
Reference in New Issue
Block a user