Browse Source

Fix text editor not saving updated text

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.02
falkTX 3 years ago
parent
commit
696d60c18b
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      plugins/Cardinal/src/TextEditor.cpp

+ 6
- 1
plugins/Cardinal/src/TextEditor.cpp View File

@@ -47,7 +47,12 @@ struct TextEditorModule : Module {


json_t* dataToJson() override 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, "filepath", json_string(file.c_str()));
json_object_set_new(rootJ, "lang", json_string(lang.c_str())); json_object_set_new(rootJ, "lang", json_string(lang.c_str()));
json_object_set_new(rootJ, "etext", json_string(text.c_str())); json_object_set_new(rootJ, "etext", json_string(text.c_str()));


Loading…
Cancel
Save