summaryrefslogtreecommitdiff
path: root/fluid/code.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-10-27 22:51:26 +0200
committerMatthias Melcher <github@matthiasm.com>2023-10-27 22:51:35 +0200
commit961d9ee71901306435a0126ca9c06d49f910857b (patch)
treebc6a2853910b455896a82455e36e503abd519849 /fluid/code.cxx
parent900337f1e38adf579f56c290de5630aab0e3b358 (diff)
FLUID: Store path to last written code file.
After some discussions it became clear that the code file may be written into an unpredictable location by the build system. Fluid now remembers that location in a user setting file and seems to do the expected thing after a brief test.
Diffstat (limited to 'fluid/code.cxx')
-rw-r--r--fluid/code.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/fluid/code.cxx b/fluid/code.cxx
index da35d3abc..65111f6cd 100644
--- a/fluid/code.cxx
+++ b/fluid/code.cxx
@@ -762,6 +762,13 @@ int Fd_Code_Writer::write_code(const char *s, const char *t, bool to_sourceview)
if (!f) {fclose(code_file); return 0;}
header_file = f;
}
+ // Remember the last code file location for MergeBack
+ if (s && g_project.write_mergeback_data && !to_sourceview) {
+ Fl_String proj_filename = g_project.projectfile_path() + g_project.projectfile_name();
+ Fl_Preferences build_records(Fl_Preferences::USER_L, "fltk.org.build", "fluid");
+ Fl_Preferences path(build_records, proj_filename.c_str());
+ path.set("code", s);
+ }
// if the first entry in the Type tree is a comment, then it is probably
// a copyright notice. We print that before anything else in the file!
Fl_Type* first_type = Fl_Type::first;