X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-syntax-window.c;h=50e7f09d1365a358cbcfcecb1e6adc8a967de197;hb=9ade26c8349;hp=1d78881904f3ef52239c303e419c5eea2a6f7f28;hpb=afdf3096926b561f4e6511c10fcf73fc6796b9d2;p=pspp-builds.git diff --git a/src/ui/gui/psppire-syntax-window.c b/src/ui/gui/psppire-syntax-window.c index 1d788819..50e7f09d 100644 --- a/src/ui/gui/psppire-syntax-window.c +++ b/src/ui/gui/psppire-syntax-window.c @@ -30,7 +30,6 @@ #include "psppire-data-window.h" #include "psppire-window-register.h" #include "psppire-syntax-window.h" -#include "syntax-editor-source.h" #include "xalloc.h" @@ -156,8 +155,16 @@ editor_execute_syntax (const PsppireSyntaxWindow *sw, GtkTextIter start, GtkTextIter 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)); + struct lex_reader *reader; + gchar *text; + + text = gtk_text_buffer_get_text (sw->buffer, &start, &stop, FALSE); + reader = lex_reader_for_string (text); + g_free (text); + + lex_reader_set_file_name (reader, psppire_window_get_filename (win)); + + execute_syntax (reader); } @@ -590,8 +597,6 @@ on_modified_changed (GtkTextBuffer *buffer, PsppireWindow *window) psppire_window_set_unsaved (window); } -extern struct source_stream *the_source_stream ; - static void psppire_syntax_window_init (PsppireSyntaxWindow *window) { @@ -616,7 +621,6 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window) window->edit_paste = get_action_assert (xml, "edit_paste"); window->buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)); - window->lexer = lex_create (the_source_stream); window->sb = get_widget_assert (xml, "statusbar2"); window->text_context = gtk_statusbar_get_context_id (GTK_STATUSBAR (window->sb), "Text Context");