Fix text editor not saving updated text

Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
falkTX 2022-01-25 00:17:43 +00:00
parent 3a5b3d17bb
commit 696d60c18b
No known key found for this signature in database
GPG key ID: CDBAA37ABC74FBA0

View file

@ -47,7 +47,12 @@ struct TextEditorModule : Module {
json_t* dataToJson() override
{
json_t* rootJ = json_object();
json_t* const rootJ = json_object();
DISTRHO_SAFE_ASSERT_RETURN(rootJ != nullptr, nullptr);
if (ImGuiTextEditor* const widget = widgetPtr)
text = widget->getText();
json_object_set_new(rootJ, "filepath", json_string(file.c_str()));
json_object_set_new(rootJ, "lang", json_string(lang.c_str()));
json_object_set_new(rootJ, "etext", json_string(text.c_str()));