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=a9b46fb9e208c694e39d6f173bfa6fe631a30129;hp=ccf94e7bf2f0298b7f38c9ca95b07905f744e07c;hpb=d0ea35a8628c8947d2e4639e7b9c8746e2f02704;p=pspp diff --git a/src/ui/gui/psppire-syntax-window.c b/src/ui/gui/psppire-syntax-window.c index ccf94e7bf2..50e7f09d13 100644 --- a/src/ui/gui/psppire-syntax-window.c +++ b/src/ui/gui/psppire-syntax-window.c @@ -21,19 +21,15 @@ #include "executor.h" #include "helper.h" +#include #include #include +#include "help-menu.h" #include "psppire.h" -#include "psppire-syntax-window.h" - #include "psppire-data-window.h" #include "psppire-window-register.h" -#include "psppire.h" -#include "help-menu.h" #include "psppire-syntax-window.h" -#include "syntax-editor-source.h" -#include #include "xalloc.h" @@ -159,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); } @@ -593,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) { @@ -619,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");