@LiquidCake commented on this pull request.
@@ -258,19 +296,26 @@ static void backupcopy_document_save_cb(GObject *obj, GeanyDocument *doc, gpoint
}
+static GeanyFiletype *get_doc_filetype_or_default(GeanyDocument *doc) { + GeanyFiletype *ft = doc->file_type; + + if (ft == NULL || ft->id == GEANY_FILETYPES_NONE) + /* ft is NULL when a new file without template was opened, so use the + * configured default file type */ + ft = filetypes_lookup_by_name(untitled_document_save_default_ft); +
done