From 662d958abf1d5bd1b0459b0caa5b4fe6be8ecabd Mon Sep 17 00:00:00 2001 From: Pal Tamas Acs Date: Mon, 11 May 2020 23:23:24 +0200 Subject: [PATCH] mousepad-view.c: Changed GtkTextView wrap mode to GTK_WRAP_WORD_CHAR This restores the old behavior. When a too long word was on the screen, mousepad didn't wrap it but extended the horizontal scroll area to the end of that word, even if word wrapping was turned on. --- mousepad/mousepad-print.c | 4 ++-- mousepad/mousepad-view.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mousepad/mousepad-print.c b/mousepad/mousepad-print.c index 0615bae..8a2c684 100644 --- a/mousepad/mousepad-print.c +++ b/mousepad/mousepad-print.c @@ -245,7 +245,7 @@ mousepad_print_settings_load (GtkPrintOperation *operation) "print-line-numbers", gtk_print_settings_get_int (settings, "line-numbers-increment"), "wrap-mode", - gtk_print_settings_get_bool (settings, "text-wrapping") ? GTK_WRAP_WORD : GTK_WRAP_NONE, + gtk_print_settings_get_bool (settings, "text-wrapping") ? GTK_WRAP_WORD_CHAR : GTK_WRAP_NONE, "highlight-syntax", gtk_print_settings_get_bool (settings, "highlight-syntax"), NULL); @@ -514,7 +514,7 @@ mousepad_print_button_toggled (GtkWidget *button, gtk_source_print_compositor_set_print_line_numbers (print->compositor, 0); } else if (button == print->widget_text_wrapping) - gtk_source_print_compositor_set_wrap_mode (print->compositor, active ? GTK_WRAP_WORD : GTK_WRAP_NONE); + gtk_source_print_compositor_set_wrap_mode (print->compositor, active ? GTK_WRAP_WORD_CHAR : GTK_WRAP_NONE); else if (button == print->widget_syntax_highlighting) gtk_source_print_compositor_set_highlight_syntax (print->compositor, active); } diff --git a/mousepad/mousepad-view.c b/mousepad/mousepad-view.c index 802f116..d93ac98 100644 --- a/mousepad/mousepad-view.c +++ b/mousepad/mousepad-view.c @@ -2818,7 +2818,7 @@ mousepad_view_set_word_wrap (MousepadView *view, g_return_if_fail (MOUSEPAD_IS_VIEW (view)); gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), - enabled ? GTK_WRAP_WORD : GTK_WRAP_NONE); + enabled ? GTK_WRAP_WORD_CHAR : GTK_WRAP_NONE); g_object_notify (G_OBJECT (view), "word-wrap"); } @@ -2833,7 +2833,7 @@ mousepad_view_get_word_wrap (MousepadView *view) mode = gtk_text_view_get_wrap_mode (GTK_TEXT_VIEW (view)); - return (mode == GTK_WRAP_WORD); + return (mode == GTK_WRAP_WORD_CHAR); } -- 2.1.4