static void
-editor_execute_syntax (const PsppireSyntaxWindow *se, GtkTextIter start,
- GtkTextIter stop)
+editor_execute_syntax (const PsppireSyntaxWindow *sw, GtkTextIter start,
+ GtkTextIter stop)
{
- execute_syntax (create_syntax_editor_source (se->buffer, start, stop));
+ PsppireWindow *win = PSPPIRE_WINDOW (sw);
+ const gchar *name = psppire_window_get_filename (win);
+ execute_syntax (create_syntax_editor_source (sw->buffer, start, stop, name));
}
psppire_window_get_filename (PsppireWindow *w)
{
const gchar *name = NULL;
- g_object_get (w, "filename", name, NULL);
+ g_object_get (w, "filename", &name, NULL);
return name;
}
GtkTextBuffer *buffer;
GtkTextIter i;
GtkTextIter end;
+ const gchar *name;
};
static const char *
name (const struct getl_interface *i)
{
- // const struct syntax_editor_source *ses =
- // (const struct syntax_editor_source *) i;
-
- return "I have no idea"; // window_name ((const struct editor_window *) ses->se);
+ const struct syntax_editor_source *ses = (const struct syntax_editor_source *) i;
+ return ses->name;
}
struct getl_interface *
create_syntax_editor_source (GtkTextBuffer *buffer,
GtkTextIter start,
- GtkTextIter stop
+ GtkTextIter stop,
+ const gchar *nm
)
{
struct syntax_editor_source *ses = xzalloc (sizeof *ses);
ses->buffer = buffer;
ses->i = start;
ses->end = stop;
+ ses->name = nm;
ses->parent.interactive = always_false;
struct getl_interface *
create_syntax_editor_source (GtkTextBuffer *buffer,
GtkTextIter start,
- GtkTextIter stop
+ GtkTextIter stop,
+ const gchar *name
);