From 961d9ee71901306435a0126ca9c06d49f910857b Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Fri, 27 Oct 2023 22:51:26 +0200 Subject: 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. --- fluid/code.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'fluid/code.cxx') 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; -- cgit v1.2.3