Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package gtksourceview5 for openSUSE:Factory checked in at 2022-06-21 17:15:06 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gtksourceview5 (Old) and /work/SRC/openSUSE:Factory/.gtksourceview5.new.1548 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gtksourceview5" Tue Jun 21 17:15:06 2022 rev:4 rq:983863 version:5.4.2 Changes: -------- --- /work/SRC/openSUSE:Factory/gtksourceview5/gtksourceview5.changes 2022-04-26 20:17:05.844711957 +0200 +++ /work/SRC/openSUSE:Factory/.gtksourceview5.new.1548/gtksourceview5.changes 2022-06-21 17:15:07.986328603 +0200 @@ -1,0 +2,39 @@ +Mon Jun 13 11:26:32 UTC 2022 - Dominique Leuenberger <dims...@opensuse.org> + +- Update to version 5.4.2: + + Updated languages: c.lang, perl.lang. + + Updated style-schemes: Adwaita-dark, solarized-light, + solarized-dark. + + Gutter renderers are now provided a prelight quark for lines + when the pointer is over the gutter. + + Hover assistants now avoid synthesized motion which is used + much more often in GTK 4 when dealing with crossing-events. + + Hover assistants will now dismiss themselves when the cursor + moves. + + GtkSourceMap has reduced how often it needs to do allocation by + ignoring spurious notify::upper and value-changed signals from + GtkTextView's vertical GtkAdjustment. + + The testsuite has gained some correctness improvements. + + The Vim emulation's register implementation is now shared + between buffers as it would be expected in Vim. + + Snippets have gained some robustness improvements including the + ability to simplify results from the snippet parser, more + defensive behavior, and being lazier when possible. + + Tabbing through focus-positions in snippets will now + immediately jump to the new position if scrolling is required + instead of animating as it results in better placement of + tooltip assistants. + + Assistants including completion, hover, and interactive + tooltips now reduce how often they request presentation and + position calculation from GDK and ultimately display servers + such as Wayland. + + Completion windows now take the size of the gutter into account + when calculating their position relative to the parent + GtkWindow so that the typed-text column remains aligned with + typed text in the source view. + + Completion has gained robustness improvements to do less work + when possible and avoid spinning the frame-clock which could + happen in certain scenarios. + + Updated translations. + +------------------------------------------------------------------- Old: ---- gtksourceview-5.4.1.tar.xz New: ---- gtksourceview-5.4.2.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gtksourceview5.spec ++++++ --- /var/tmp/diff_new_pack.ZmW1vq/_old 2022-06-21 17:15:08.534329161 +0200 +++ /var/tmp/diff_new_pack.ZmW1vq/_new 2022-06-21 17:15:08.538329165 +0200 @@ -18,7 +18,7 @@ %define _name gtksourceview Name: gtksourceview5 -Version: 5.4.1 +Version: 5.4.2 Release: 0 Summary: GTK+ Source Editing Widget License: LGPL-2.1-or-later ++++++ gtksourceview-5.4.1.tar.xz -> gtksourceview-5.4.2.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/.gitignore new/gtksourceview-5.4.2/.gitignore --- old/gtksourceview-5.4.1/.gitignore 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/.gitignore 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -*~ -*.swp -build -_build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/.gitlab-ci/fedora.Dockerfile new/gtksourceview-5.4.2/.gitlab-ci/fedora.Dockerfile --- old/gtksourceview-5.4.1/.gitlab-ci/fedora.Dockerfile 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/.gitlab-ci/fedora.Dockerfile 2022-06-12 19:45:06.592905500 +0200 @@ -1,16 +1,20 @@ -FROM fedora:35 +FROM fedora:36 RUN dnf update -y RUN dnf -y install \ meson \ vala \ + libvala-devel \ gtk4-devel \ ninja-build \ pkgconf \ clang \ gobject-introspection-devel \ vulkan-headers \ - python3-pip + python3-pip \ + wayland-devel \ + wayland-protocols-devel \ + sysprof-devel RUN dnf clean all diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/NEWS new/gtksourceview-5.4.2/NEWS --- old/gtksourceview-5.4.1/NEWS 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/NEWS 2022-06-12 19:45:06.593905400 +0200 @@ -1,3 +1,40 @@ +News in 5.4.2, 2022-06-12 +------------------------- + + * Updated languages: c.lang, perl.lang + * Updated style-schemes: Adwaita-dark, solarized-light, solarized-dark + * Updated translations: Friulian + * Gutter renderers are now provided a prelight quark for lines when the + pointer is over the gutter. + * Hover assistants now avoid synthesized motion which is used much more + often in GTK 4 when dealing with crossing-events. + * Hover assistants will now dismiss themselves when the cursor moves. + * GtkSourceMap has reduced how often it needs to do allocation by ignoring + spurious notify::upper and value-changed signals from GtkTextView's + vertical GtkAdjustment. + * The testsuite has gained some correctness improvements thanks to + issues pointed out by S??bastien Wilmet. + * The Vim emulation's register implementation is now shared between buffers + as it would be expected in Vim. + * Snippets have gained some robustness improvements including the ability + to simplify results from the snippet parser, more defensive behavior, + and being lazier when possible. + * Tabbing through focus-positions in snippets will now immediately jump + to the new position if scrolling is required instead of animating as + it results in better placement of tooltip assistants. + * Assistants including completion, hover, and interactive tooltips now + reduce how often they request presentation and position calculation from + GDK and ultimately display servers such as Wayland. + * Completion windows now take the size of the gutter into account when + calculating their position relative to the parent GtkWindow so that the + typed-text column remains aligned with typed text in the source view. + * Completion has gained robustness improvements to do less work when + possible and avoid spinning the frame-clock which could happen in + certain scenarios. + +It is recommended that distributions update to this release if they are +already shipping a GtkSourceView 5.4.x release. + News in 5.4.1, 2022-04-21 ------------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/data/language-specs/c.lang new/gtksourceview-5.4.2/data/language-specs/c.lang --- old/gtksourceview-5.4.1/data/language-specs/c.lang 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/data/language-specs/c.lang 2022-06-12 19:45:06.598905600 +0200 @@ -62,7 +62,9 @@ \\( # leading backslash [\\\"\'nrbtfav\?] | # escaped character [0-7]{1,3} | # one, two, or three octal digits - x[0-9A-Fa-f]+ # 'x' followed by hex digits + x[0-9A-Fa-f]+ | # 'x' followed by hex digits + u[0-9A-Fa-f]{4} | # 'u' followed by 4 hex digits + U[0-9A-Fa-f]{8} # 'U' followed by 8 hex digits ) </define-regex> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/data/language-specs/perl.lang new/gtksourceview-5.4.2/data/language-specs/perl.lang --- old/gtksourceview-5.4.1/data/language-specs/perl.lang 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/data/language-specs/perl.lang 2022-06-12 19:45:06.612905700 +0200 @@ -1022,7 +1022,7 @@ </context> <context id="pod" style-ref="pod" class-disabled="no-spell-check"> - <start>^(?=(=[a-z]))</start> + <start>^(?=(=(?!end))[a-z])</start> <end>^=(cut)$</end> <include> <context sub-pattern="1" where="end" style-ref="pod-keyword"/> @@ -1033,7 +1033,7 @@ </context> <context> <start>^=(begin)\s+(.*)$</start> - <end>^=(end)\s+\%{1@start}$</end> + <end>^=(end)\s+\%{2@start}$</end> <include> <context sub-pattern="1" where="start" style-ref="pod-keyword"/> <context sub-pattern="1" where="end" style-ref="pod-keyword"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/data/styles/Adwaita-dark.xml new/gtksourceview-5.4.2/data/styles/Adwaita-dark.xml --- old/gtksourceview-5.4.1/data/styles/Adwaita-dark.xml 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/data/styles/Adwaita-dark.xml 2022-06-12 19:45:06.620905900 +0200 @@ -97,13 +97,13 @@ <style name="bracket-match" bold="true"/> <style name="current-line" background="libadwaita-dark-alt"/> <style name="current-line-number" background="libadwaita-dark-alt" foreground="light_7"/> + <style name="cursor" foreground="light_5"/> <style name="draw-spaces" foreground="dark_3"/> <style name="line-numbers" background="libadwaita-dark" foreground="dark_2"/> <style name="map-overlay" background="dark_1"/> <style name="right-margin" background="dark_1" foreground="dark_1"/> <style name="search-match" background="yellow_4" foreground="dark_4"/> <style name="text" background="libadwaita-dark" foreground="light_5"/> - <style name="cursor" foreground="light_5"/> <!-- Defaults --> <style name="def:base-n-integer" foreground="violet_2"/> @@ -113,9 +113,11 @@ <style name="def:decimal" foreground="violet_2"/> <style name="def:deletion" strikethrough="true"/> <style name="def:doc-comment-element" foreground="light_7"/> + <style name="def:emphasis" italic="true"/> <style name="def:floating-point" foreground="violet_2"/> <style name="def:function" foreground="blue_2"/> <style name="def:heading" foreground="teal_3" bold="true"/> + <style name="def:inline-code" foreground="violet_2"/> <style name="def:keyword" foreground="orange_2" bold="true"/> <style name="def:link-destination" foreground="blue_2" italic="true" underline="low"/> <style name="def:link-text" foreground="red_2"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/data/styles/solarized-dark.xml new/gtksourceview-5.4.2/data/styles/solarized-dark.xml --- old/gtksourceview-5.4.1/data/styles/solarized-dark.xml 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/data/styles/solarized-dark.xml 2022-06-12 19:45:06.622906000 +0200 @@ -108,6 +108,13 @@ <style name="def:preformatted-section" foreground="blue"/> <style name="def:list-marker" foreground="orange"/> + <!-- Diff --> + <style name="diff:added-line" foreground="green"/> + <style name="diff:removed-line" foreground="red"/> + <style name="diff:changed-line" foreground="yellow"/> + <style name="diff:location" foreground="blue"/> + <style name="diff:diff-file" foreground="yellow"/> + <!-- Operators --> <style name="def:operator" foreground="green"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/data/styles/solarized-light.xml new/gtksourceview-5.4.2/data/styles/solarized-light.xml --- old/gtksourceview-5.4.1/data/styles/solarized-light.xml 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/data/styles/solarized-light.xml 2022-06-12 19:45:06.622906000 +0200 @@ -109,6 +109,13 @@ <style name="def:preformatted-section" foreground="blue"/> <style name="def:list-marker" foreground="orange"/> + <!-- Diff --> + <style name="diff:added-line" foreground="green"/> + <style name="diff:removed-line" foreground="red"/> + <style name="diff:changed-line" foreground="yellow"/> + <style name="diff:location" foreground="blue"/> + <style name="diff:diff-file" foreground="yellow"/> + <!-- Operators --> <style name="def:operator" foreground="green"/> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/gtksourceview/gtksourceassistant.c new/gtksourceview-5.4.2/gtksourceview/gtksourceassistant.c --- old/gtksourceview-5.4.1/gtksourceview/gtksourceassistant.c 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/gtksourceview/gtksourceassistant.c 2022-06-12 19:45:06.626906000 +0200 @@ -103,6 +103,19 @@ GTK_SOURCE_ASSISTANT_GET_CLASS (assistant)->get_target_location (assistant, location); } +static int +get_gutter_width (GtkSourceView *view) +{ + GtkSourceGutter *left = gtk_source_view_get_gutter (view, GTK_TEXT_WINDOW_LEFT); + + if (left != NULL) + { + return gtk_widget_get_width (GTK_WIDGET (left)); + } + + return 0; +} + static void _gtk_source_assistant_update_position (GtkSourceAssistant *assistant) { @@ -119,15 +132,21 @@ if (GTK_SOURCE_IS_VIEW (parent)) { + GdkRectangle visible_rect; + + gtk_text_view_get_visible_rect (GTK_TEXT_VIEW (parent), &visible_rect); + _gtk_source_assistant_get_offset (assistant, &x, &y); _gtk_source_assistant_get_target_location (assistant, &rect); + rect.x -= visible_rect.x; + rect.y -= visible_rect.y; + rect.x += get_gutter_width (GTK_SOURCE_VIEW (parent)); + gtk_popover_set_offset (GTK_POPOVER (assistant), x, y); gtk_popover_set_pointing_to (GTK_POPOVER (assistant), &rect); } - gtk_popover_present (GTK_POPOVER (assistant)); - if (priv->child != NULL) { children = _gtk_source_assistant_child_get_attached (priv->child); @@ -139,8 +158,6 @@ _gtk_source_assistant_get_offset (child, &x, &y); gtk_popover_set_offset (GTK_POPOVER (child), x, y); - - gtk_popover_present (GTK_POPOVER (child)); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/gtksourceview/gtksourcecompletionlistbox.c new/gtksourceview-5.4.2/gtksourceview/gtksourcecompletionlistbox.c --- old/gtksourceview-5.4.1/gtksourceview/gtksourcecompletionlistbox.c 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/gtksourceview/gtksourcecompletionlistbox.c 2022-06-12 19:45:06.629906000 +0200 @@ -871,9 +871,9 @@ } else { + gtk_widget_hide (GTK_WIDGET (iter)); _gtk_source_completion_list_box_row_display (GTK_SOURCE_COMPLETION_LIST_BOX_ROW (iter), NULL, NULL, NULL, self->show_icons, FALSE); - gtk_widget_hide (GTK_WIDGET (iter)); } state.position++; @@ -903,8 +903,20 @@ g_assert (GTK_SOURCE_IS_COMPLETION_LIST_BOX (self)); - gtk_source_completion_list_box_do_update (self, TRUE); self->queued_update = 0; + + gtk_source_completion_list_box_do_update (self, TRUE); + + /* There is a chance that the update sequence could cause us to need + * to queue another update. But we don't actually need it. Just cancel + * any additional request immediately. + */ + if (self->queued_update != 0) + { + gtk_widget_remove_tick_callback (GTK_WIDGET (self), self->queued_update); + self->queued_update = 0; + } + return G_SOURCE_REMOVE; } @@ -1075,9 +1087,14 @@ offset = gtk_source_completion_list_box_get_offset (self); - /* Skip widget resize if results are after visible area */ - if (position >= offset + self->n_rows) + /* Skip widget resize if results are out of view and wont force our + * current results down. + */ + if ((position >= offset + self->n_rows) || + (removed == added && (position + added) < offset)) + { return; + } gtk_source_completion_list_box_queue_update (self); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/gtksourceview/gtksourcegutter.c new/gtksourceview-5.4.2/gtksourceview/gtksourcegutter.c --- old/gtksourceview-5.4.1/gtksourceview/gtksourcegutter.c 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/gtksourceview/gtksourcegutter.c 2022-06-12 19:45:06.633906100 +0200 @@ -80,7 +80,11 @@ GtkTextWindowType window_type; GtkOrientation orientation; + double pointer_x; + double pointer_y; + guint is_drawing : 1; + guint pointer_in_gutter : 1; }; G_DEFINE_TYPE (GtkSourceGutter, gtk_source_gutter, GTK_TYPE_WIDGET) @@ -320,10 +324,40 @@ } static void -gtk_source_gutter_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) +gtk_source_gutter_motion_cb (GtkSourceGutter *gutter, + double x, + double y, + GtkEventControllerMotion *motion) +{ + g_assert (GTK_SOURCE_IS_GUTTER (gutter)); + g_assert (GTK_IS_EVENT_CONTROLLER_MOTION (motion)); + + gutter->pointer_x = x; + gutter->pointer_y = y; + gutter->pointer_in_gutter = TRUE; + + _gtk_source_gutter_queue_draw (gutter); +} + +static void +gtk_source_gutter_leave_cb (GtkSourceGutter *gutter, + GtkEventControllerMotion *motion) +{ + g_assert (GTK_SOURCE_IS_GUTTER (gutter)); + g_assert (GTK_IS_EVENT_CONTROLLER_MOTION (motion)); + + gutter->pointer_x = -1; + gutter->pointer_y = -1; + gutter->pointer_in_gutter = FALSE; + + _gtk_source_gutter_queue_draw (gutter); +} + +static void +gtk_source_gutter_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) { GtkSourceGutter *gutter = GTK_SOURCE_GUTTER (object); @@ -457,15 +491,15 @@ motion = gtk_event_controller_motion_new (); g_signal_connect_swapped (motion, "enter", - G_CALLBACK (gtk_widget_queue_draw), + G_CALLBACK (gtk_source_gutter_motion_cb), gutter); g_signal_connect_swapped (motion, "leave", - G_CALLBACK (gtk_widget_queue_draw), + G_CALLBACK (gtk_source_gutter_leave_cb), gutter); g_signal_connect_swapped (motion, "motion", - G_CALLBACK (gtk_widget_queue_draw), + G_CALLBACK (gtk_source_gutter_motion_cb), gutter); gtk_widget_add_controller (GTK_WIDGET (gutter), motion); } @@ -742,6 +776,27 @@ needs_wrap_first, needs_wrap_last); + /* Get the line under the pointer so we can set "prelit" on it */ + if (gutter->pointer_in_gutter) + { + GtkTextIter pointer; + GdkRectangle pointer_rect; + + gtk_text_view_get_iter_at_location (text_view, + &pointer, + 0, + visible_rect.y + gutter->pointer_y); + gtk_text_view_get_iter_location (text_view, &pointer, &pointer_rect); + pointer_rect.y -= visible_rect.y; + + if (gutter->pointer_y >= pointer_rect.y && + gutter->pointer_y <= pointer_rect.y + pointer_rect.height) + { + guint line = gtk_text_iter_get_line (&pointer); + gtk_source_gutter_lines_add_class (gutter->lines, line, "prelit"); + } + } + /* Draw the current-line highlight if necessary */ if (gtk_source_view_get_highlight_current_line (gutter->view) && !gtk_text_buffer_get_selection_bounds (buffer, &cur, &sel)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/gtksourceview/gtksourcegutterlines.c new/gtksourceview-5.4.2/gtksourceview/gtksourcegutterlines.c --- old/gtksourceview-5.4.1/gtksourceview/gtksourcegutterlines.c 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/gtksourceview/gtksourcegutterlines.c 2022-06-12 19:45:06.633906100 +0200 @@ -114,9 +114,12 @@ GtkTextBuffer *buffer; GtkTextMark *mark; GtkTextIter iter; + GtkTextIter sel_begin, sel_end; gboolean single_line; guint cursor_line; guint i; + int first_selected = -1; + int last_selected = -1; g_return_val_if_fail (GTK_IS_TEXT_VIEW (text_view), NULL); g_return_val_if_fail (begin != NULL, NULL); @@ -128,6 +131,13 @@ g_return_val_if_fail (gtk_text_iter_get_buffer (begin) == buffer, NULL); g_return_val_if_fail (gtk_text_iter_get_buffer (end) == buffer, NULL); + if (gtk_text_buffer_get_selection_bounds (buffer, &sel_begin, &sel_end)) + { + gtk_text_iter_order (&sel_begin, &sel_end); + first_selected = gtk_text_iter_get_line (&sel_begin); + last_selected = gtk_text_iter_get_line (&sel_end); + } + if (gtk_text_iter_compare (begin, end) > 0) { const GtkTextIter *tmp = begin; @@ -249,6 +259,11 @@ quark_set_add (&info.classes, q_cursor_line); } + if G_UNLIKELY (i >= first_selected && i <= last_selected) + { + quark_set_add (&info.classes, q_selected); + } + g_array_append_val (lines->lines, info); if G_UNLIKELY (!gtk_text_iter_forward_line (&iter) && diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/gtksourceview/gtksourcegutterrenderer.c new/gtksourceview-5.4.2/gtksourceview/gtksourcegutterrenderer.c --- old/gtksourceview-5.4.1/gtksourceview/gtksourcegutterrenderer.c 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/gtksourceview/gtksourcegutterrenderer.c 2022-06-12 19:45:06.634906000 +0200 @@ -192,12 +192,22 @@ first = gtk_source_gutter_lines_get_first (lines); last = gtk_source_gutter_lines_get_last (lines); - for (line = first; line <= last; line++) + if (klass->query_data) { - gtk_source_gutter_lines_get_line_yrange (lines, line, mode, &y, &h); - - klass->query_data (renderer, lines, line); - klass->snapshot_line (renderer, snapshot, lines, line); + for (line = first; line <= last; line++) + { + gtk_source_gutter_lines_get_line_yrange (lines, line, mode, &y, &h); + klass->query_data (renderer, lines, line); + klass->snapshot_line (renderer, snapshot, lines, line); + } + } + else + { + for (line = first; line <= last; line++) + { + gtk_source_gutter_lines_get_line_yrange (lines, line, mode, &y, &h); + klass->snapshot_line (renderer, snapshot, lines, line); + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/gtksourceview/gtksourcehover.c new/gtksourceview-5.4.2/gtksourceview/gtksourcehover.c --- old/gtksourceview-5.4.1/gtksourceview/gtksourcehover.c 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/gtksourceview/gtksourcehover.c 2022-06-12 19:45:06.635906200 +0200 @@ -22,6 +22,7 @@ #include "config.h" #include "gtksourceassistant-private.h" +#include "gtksourcebuffer.h" #include "gtksourcehover-private.h" #include "gtksourcehoverassistant-private.h" #include "gtksourcehovercontext.h" @@ -34,7 +35,7 @@ /** * GtkSourceHover: - * + * * Interactive tooltips. * * `GtkSourceHover` allows a [class@View] to provide contextual information. @@ -56,6 +57,7 @@ GtkSourceView *view; GtkSourceAssistant *assistant; + GtkTextBuffer *buffer; GPtrArray *providers; @@ -76,6 +78,57 @@ static GParamSpec *properties [N_PROPS]; +static void +cursor_moved_cb (GtkSourceHover *hover, + GtkSourceBuffer *buffer) +{ + g_assert (GTK_SOURCE_IS_HOVER (hover)); + g_assert (GTK_SOURCE_IS_BUFFER (buffer)); + + g_clear_handle_id (&hover->settle_source, g_source_remove); + _gtk_source_hover_assistant_dismiss (GTK_SOURCE_HOVER_ASSISTANT (hover->assistant)); +} + +static void +gtk_source_hover_notify_buffer (GtkSourceHover *hover, + GParamSpec *pspec, + GtkSourceView *view) +{ + GtkTextBuffer *buffer; + + g_assert (GTK_SOURCE_IS_HOVER (hover)); + g_assert (GTK_SOURCE_IS_VIEW (view)); + + buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); + + if (buffer == hover->buffer) + { + return; + } + + if (hover->buffer != NULL) + { + g_signal_handlers_disconnect_by_func (hover->buffer, + G_CALLBACK (cursor_moved_cb), + hover); + g_clear_weak_pointer (&hover->buffer); + } + + if (!GTK_SOURCE_IS_BUFFER (buffer)) + { + return; + } + + if (g_set_weak_pointer (&hover->buffer, buffer)) + { + g_signal_connect_object (hover->buffer, + "cursor-moved", + G_CALLBACK (cursor_moved_cb), + hover, + G_CONNECT_SWAPPED); + } +} + static gboolean gtk_source_hover_get_bounds (GtkSourceHover *self, GtkTextIter *begin, @@ -198,6 +251,12 @@ g_assert (GTK_SOURCE_IS_HOVER (self)); g_assert (GTK_IS_EVENT_CONTROLLER_MOTION (controller)); + /* Ignore synthesized motion events */ + if (self->motion_x == x && self->motion_y == y) + { + return; + } + self->motion_x = x; self->motion_y = y; @@ -237,6 +296,7 @@ g_clear_handle_id (&self->settle_source, g_source_remove); g_clear_pointer (&self->assistant, _gtk_source_assistant_destroy); g_clear_weak_pointer (&self->view); + g_clear_weak_pointer (&self->buffer); if (self->providers->len > 0) { @@ -371,6 +431,13 @@ G_CONNECT_SWAPPED); gtk_widget_add_controller (GTK_WIDGET (view), scroll); + g_signal_connect_object (view, + "notify::buffer", + G_CALLBACK (gtk_source_hover_notify_buffer), + self, + G_CONNECT_SWAPPED); + gtk_source_hover_notify_buffer (self, NULL, view); + return self; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/gtksourceview/gtksourcemap.c new/gtksourceview-5.4.2/gtksourceview/gtksourcemap.c --- old/gtksourceview-5.4.1/gtksourceview/gtksourcemap.c 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/gtksourceview/gtksourcemap.c 2022-06-12 19:45:06.638906200 +0200 @@ -182,6 +182,12 @@ /* The location of the slider in widget coordinate space. */ GdkRectangle slider_area; + /* We compare against old values from the vadjustment as it can + * notify a bit more than is necessary. + */ + double last_vadj_upper; + double last_vadj_value; + /* Weak pointer view to child view bindings */ GBinding *buffer_binding; GBinding *indent_width_binding; @@ -479,7 +485,7 @@ static void update_child_vadjustment (GtkSourceMap *map) { - GtkSourceMapPrivate *priv; + GtkSourceMapPrivate *priv = gtk_source_map_get_instance_private (map); GtkAdjustment *vadj; GtkAdjustment *child_vadj; gdouble value; @@ -489,8 +495,6 @@ gdouble child_page_size; gdouble new_value = 0.0; - priv = gtk_source_map_get_instance_private (map); - vadj = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (priv->view)); g_object_get (vadj, "upper", &upper, @@ -521,8 +525,15 @@ view_vadj_value_changed (GtkSourceMap *map, GtkAdjustment *vadj) { - update_child_vadjustment (map); - gtk_widget_queue_allocate (GTK_WIDGET (map)); + GtkSourceMapPrivate *priv = gtk_source_map_get_instance_private (map); + double value = gtk_adjustment_get_value (vadj); + + if (value != priv->last_vadj_value) + { + priv->last_vadj_value = value; + update_child_vadjustment (map); + gtk_widget_queue_allocate (GTK_WIDGET (map)); + } } static void @@ -530,7 +541,14 @@ GParamSpec *pspec, GtkAdjustment *vadj) { - gtk_widget_queue_allocate (GTK_WIDGET (map)); + GtkSourceMapPrivate *priv = gtk_source_map_get_instance_private (map); + double upper = gtk_adjustment_get_upper (vadj); + + if (upper != priv->last_vadj_upper) + { + priv->last_vadj_upper = upper; + gtk_widget_queue_allocate (GTK_WIDGET (map)); + } } static void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/gtksourceview/gtksourcesnippet.c new/gtksourceview-5.4.2/gtksourceview/gtksourcesnippet.c --- old/gtksourceview-5.4.1/gtksourceview/gtksourcesnippet.c 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/gtksourceview/gtksourcesnippet.c 2022-06-12 19:45:06.642906200 +0200 @@ -210,12 +210,18 @@ gtk_source_snippet_get_nth_chunk (GtkSourceSnippet *snippet, guint nth) { + GtkSourceSnippetChunk *chunk = NULL; + g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), 0); if (nth < snippet->chunks.length) - return g_queue_peek_nth (&snippet->chunks, nth); + { + chunk = g_queue_peek_nth (&snippet->chunks, nth); + } + + g_return_val_if_fail (!chunk || GTK_SOURCE_IS_SNIPPET_CHUNK (chunk), NULL); - return NULL; + return chunk; } /** @@ -849,11 +855,11 @@ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet)); g_return_if_fail (GTK_SOURCE_IS_SNIPPET_CHUNK (chunk)); g_return_if_fail (!snippet->inserted); - g_return_if_fail (chunk->link.data != NULL); + g_return_if_fail (chunk->link.data == chunk); g_return_if_fail (chunk->link.prev == NULL); g_return_if_fail (chunk->link.next == NULL); - g_object_ref_sink (chunk); + g_object_ref (chunk); g_queue_push_tail_link (&snippet->chunks, &chunk->link); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/gtksourceview/gtksourcesnippetbundle.c new/gtksourceview-5.4.2/gtksourceview/gtksourcesnippetbundle.c --- old/gtksourceview-5.4.1/gtksourceview/gtksourcesnippetbundle.c 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/gtksourceview/gtksourcesnippetbundle.c 2022-06-12 19:45:06.643906000 +0200 @@ -255,9 +255,15 @@ for (guint i = 0; state->languages[i]; i++) { - info.language = _gtk_source_snippet_manager_intern (state->manager, state->languages[i]); + char *stripped = g_strstrip (g_strdup (state->languages[i])); - gtk_source_snippet_bundle_add (state->self, &info); + if (stripped != NULL && stripped[0] != 0) + { + info.language = _gtk_source_snippet_manager_intern (state->manager, stripped); + gtk_source_snippet_bundle_add (state->self, &info); + } + + g_free (stripped); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/gtksourceview/gtksourceview-assistants.c new/gtksourceview-5.4.2/gtksourceview/gtksourceview-assistants.c --- old/gtksourceview-5.4.1/gtksourceview/gtksourceview-assistants.c 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/gtksourceview/gtksourceview-assistants.c 2022-06-12 19:45:06.650906300 +0200 @@ -103,7 +103,14 @@ g_assert (GTK_SOURCE_IS_ASSISTANT (assistant)); - gtk_popover_present (GTK_POPOVER (assistant)); + if (gtk_widget_get_visible (GTK_WIDGET (assistant)) && + gtk_native_get_surface (GTK_NATIVE (assistant)) != NULL) + { + GtkRequisition req; + + gtk_widget_get_preferred_size (GTK_WIDGET (assistant), NULL, &req); + gtk_popover_present (GTK_POPOVER (assistant)); + } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/gtksourceview/gtksourceview-snippets.c new/gtksourceview-5.4.2/gtksourceview/gtksourceview-snippets.c --- old/gtksourceview-5.4.1/gtksourceview/gtksourceview-snippets.c 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/gtksourceview/gtksourceview-snippets.c 2022-06-12 19:45:06.650906300 +0200 @@ -28,6 +28,9 @@ #include "gtksourcesnippetchunk-private.h" #include "gtksourcesnippetmanager.h" #include "gtksourceview-private.h" +#include "gtksourceutils-private.h" + +static void gtk_source_view_snippets_update_informative (GtkSourceViewSnippets *snippets); static void gtk_source_view_snippets_block (GtkSourceViewSnippets *snippets) @@ -67,11 +70,36 @@ gtk_source_view_snippets_scroll_to_insert (GtkSourceViewSnippets *snippets) { GtkTextMark *mark; + GtkTextIter iter; + GdkRectangle area; + GdkRectangle visible_rect; + double x, y; g_assert (snippets != NULL); mark = gtk_text_buffer_get_insert (GTK_TEXT_BUFFER (snippets->buffer)); - gtk_text_view_scroll_mark_onscreen (GTK_TEXT_VIEW (snippets->view), mark); + gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (snippets->buffer), &iter, mark); + gtk_text_view_get_iter_location (GTK_TEXT_VIEW (snippets->view), &iter, &area); + gtk_text_view_get_visible_rect (GTK_TEXT_VIEW (snippets->view), &visible_rect); + + if (area.x < visible_rect.x) + x = area.x; + else if (area.x > visible_rect.x + visible_rect.width) + x = area.x - visible_rect.width; + else + x = visible_rect.x; + + if (area.y < visible_rect.y) + y = area.y; + else if (area.y > visible_rect.y + visible_rect.height) + y = area.y - visible_rect.height; + else + y = visible_rect.y; + + gtk_adjustment_set_value (gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (snippets->view)), x); + gtk_adjustment_set_value (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (snippets->view)), y); + + gtk_source_view_snippets_update_informative (snippets); } static void @@ -312,6 +340,17 @@ goto hide_informative; } + if (snippets->informative == NULL) + { + snippets->informative = g_object_new (GTK_SOURCE_TYPE_INFORMATIVE, + "position", GTK_POS_TOP, + "message-type", GTK_MESSAGE_INFO, + "icon-name", "completion-snippet-symbolic", + NULL); + _gtk_source_view_add_assistant (snippets->view, + GTK_SOURCE_ASSISTANT (snippets->informative)); + } + _gtk_source_assistant_set_mark (GTK_SOURCE_ASSISTANT (snippets->informative), chunk->begin_mark); gtk_source_informative_set_message (snippets->informative, tooltip_text); @@ -327,7 +366,10 @@ return; hide_informative: - gtk_widget_hide (GTK_WIDGET (snippets->informative)); + if (snippets->informative != NULL) + { + gtk_widget_hide (GTK_WIDGET (snippets->informative)); + } } static void @@ -386,14 +428,6 @@ _gtk_source_view_snippets_set_buffer (snippets, GTK_SOURCE_BUFFER (buffer)); } - - snippets->informative = g_object_new (GTK_SOURCE_TYPE_INFORMATIVE, - "position", GTK_POS_TOP, - "message-type", GTK_MESSAGE_INFO, - "icon-name", "completion-snippet-symbolic", - NULL); - _gtk_source_view_add_assistant (snippets->view, - GTK_SOURCE_ASSISTANT (snippets->informative)); } void @@ -415,8 +449,11 @@ g_clear_signal_handler (&snippets->buffer_cursor_moved_handler, snippets->buffer); - _gtk_source_view_remove_assistant (snippets->view, - GTK_SOURCE_ASSISTANT (snippets->informative)); + if (snippets->informative != NULL) + { + _gtk_source_view_remove_assistant (snippets->view, + GTK_SOURCE_ASSISTANT (snippets->informative)); + } if (snippets->snippet_signals != NULL) { @@ -661,7 +698,10 @@ g_object_unref (snippet); - gtk_widget_hide (GTK_WIDGET (snippets->informative)); + if (snippets->informative != NULL) + { + gtk_widget_hide (GTK_WIDGET (snippets->informative)); + } } snippet = g_queue_peek_head (&snippets->queue); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/gtksourceview/vim/gtksourcevimregisters.c new/gtksourceview-5.4.2/gtksourceview/vim/gtksourcevimregisters.c --- old/gtksourceview-5.4.1/gtksourceview/vim/gtksourcevimregisters.c 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/gtksourceview/vim/gtksourcevimregisters.c 2022-06-12 19:45:06.655906400 +0200 @@ -29,50 +29,28 @@ struct _GtkSourceVimRegisters { GtkSourceVimState parent_instance; - - GHashTable *values; - - char *clipboard; - char *primary_clipboard; - - char *numbered[10]; - int numbered_pos; }; G_DEFINE_TYPE (GtkSourceVimRegisters, gtk_source_vim_registers, GTK_SOURCE_TYPE_VIM_STATE) -static void -gtk_source_vim_registers_finalize (GObject *object) -{ - GtkSourceVimRegisters *self = (GtkSourceVimRegisters *)object; - - g_clear_pointer (&self->values, g_hash_table_unref); - g_clear_pointer (&self->clipboard, g_ref_string_release); - g_clear_pointer (&self->primary_clipboard, g_ref_string_release); - - for (guint i = 0; i < G_N_ELEMENTS (self->numbered); i++) - { - g_clear_pointer (&self->numbered[i], g_ref_string_release); - } - - G_OBJECT_CLASS (gtk_source_vim_registers_parent_class)->finalize (object); -} +static GHashTable *g_values; +static char *g_clipboard; +static char *g_primary_clipboard; +static char *g_numbered[10]; +static int g_numbered_pos; static void gtk_source_vim_registers_class_init (GtkSourceVimRegistersClass *klass) { - GObjectClass *object_class = G_OBJECT_CLASS (klass); - - object_class->finalize = gtk_source_vim_registers_finalize; + g_values = g_hash_table_new_full (g_str_hash, + g_str_equal, + NULL, + (GDestroyNotify)g_ref_string_release); } static void gtk_source_vim_registers_init (GtkSourceVimRegisters *self) { - self->values = g_hash_table_new_full (g_str_hash, - g_str_equal, - NULL, - (GDestroyNotify)g_ref_string_release); } static void @@ -188,18 +166,18 @@ if (g_str_equal (name, "+")) { GdkClipboard *clipboard = gtk_widget_get_clipboard (GTK_WIDGET (view)); - read_clipboard (self, clipboard, &self->clipboard); - return self->clipboard; + read_clipboard (self, clipboard, &g_clipboard); + return g_clipboard; } else if (g_str_equal (name, "*")) { GdkClipboard *clipboard = gtk_widget_get_primary_clipboard (GTK_WIDGET (view)); - read_clipboard (self, clipboard, &self->primary_clipboard); - return self->primary_clipboard; + read_clipboard (self, clipboard, &g_primary_clipboard); + return g_primary_clipboard; } else { - return g_hash_table_lookup (self->values, name); + return g_hash_table_lookup (g_values, name); } } @@ -207,7 +185,7 @@ get_numbered_pos (GtkSourceVimRegisters *self, guint n) { - return &self->numbered[(self->numbered_pos + n) % 10]; + return &g_numbered[(g_numbered_pos + n) % 10]; } const char * @@ -228,13 +206,13 @@ g_return_if_fail (GTK_SOURCE_IS_VIM_REGISTERS (self)); - if (self->numbered_pos == 0) + if (g_numbered_pos == 0) { - self->numbered_pos = G_N_ELEMENTS (self->numbered) - 1; + g_numbered_pos = G_N_ELEMENTS (g_numbered) - 1; } else { - self->numbered_pos--; + g_numbered_pos--; } pos = get_numbered_pos (self, 0); @@ -270,7 +248,7 @@ if (value == NULL) { - g_hash_table_remove (self->values, name); + g_hash_table_remove (g_values, name); return; } @@ -289,7 +267,7 @@ } else { - g_hash_table_insert (self->values, + g_hash_table_insert (g_values, (char *)g_intern_string (name), str); } @@ -323,3 +301,22 @@ return FALSE; } } + +void +gtk_source_vim_registers_reset (GtkSourceVimRegisters *self) +{ + g_return_if_fail (GTK_SOURCE_IS_VIM_REGISTERS (self)); + + g_hash_table_remove_all (g_values); + + /* Clear global state, but this is just for tests anyway */ + g_clear_pointer (&g_clipboard, g_ref_string_release); + g_clear_pointer (&g_primary_clipboard, g_ref_string_release); + + for (guint i = 0; i < G_N_ELEMENTS (g_numbered); i++) + { + g_clear_pointer (&g_numbered[i], g_ref_string_release); + } + + g_numbered_pos = 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/gtksourceview/vim/gtksourcevimregisters.h new/gtksourceview-5.4.2/gtksourceview/vim/gtksourcevimregisters.h --- old/gtksourceview-5.4.1/gtksourceview/vim/gtksourcevimregisters.h 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/gtksourceview/vim/gtksourcevimregisters.h 2022-06-12 19:45:06.655906400 +0200 @@ -37,6 +37,7 @@ void gtk_source_vim_registers_set (GtkSourceVimRegisters *self, const char *name, const char *string); +void gtk_source_vim_registers_reset (GtkSourceVimRegisters *self); void gtk_source_vim_registers_clear (GtkSourceVimRegisters *self, const char *name); gboolean gtk_source_vim_register_is_read_only (const char *name); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/meson.build new/gtksourceview-5.4.2/meson.build --- old/gtksourceview-5.4.1/meson.build 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/meson.build 2022-06-12 19:45:06.656906400 +0200 @@ -1,5 +1,5 @@ project('gtksourceview', 'c', - version: '5.4.1', + version: '5.4.2', license: 'LGPL-2.1-or-later', meson_version: '>= 0.59.0', default_options: [ 'c_std=gnu99', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/po/fur.po new/gtksourceview-5.4.2/po/fur.po --- old/gtksourceview-5.4.1/po/fur.po 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/po/fur.po 2022-06-12 19:45:06.680906800 +0200 @@ -7,15 +7,15 @@ msgstr "" "Project-Id-Version: gtksourceview gnome-3-24\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/gtksourceview/issues\n" -"POT-Creation-Date: 2021-10-13 11:26+0000\n" -"PO-Revision-Date: 2021-11-07 18:08+0100\n" +"POT-Creation-Date: 2022-05-02 11:09+0000\n" +"PO-Revision-Date: 2022-05-07 20:34+0200\n" "Last-Translator: Fabio Tomat <f.t.pub...@gmail.com>\n" "Language-Team: Friulian <f...@li.org>\n" "Language: fur\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 3.0\n" +"X-Generator: Poedit 3.0.1\n" #. (itstool) path: abnf.lang/language@_section #. (itstool) path: actionscript.lang/language@_section @@ -300,20 +300,15 @@ msgstr "Adwaita Dark" #. (itstool) path: style-scheme/_description -#: Adwaita-dark.xml:22 -msgid "A dark color scheme matching GTK's default theme" -msgstr "Un scheme di col??rs sc??rs che al coinc??t cul teme predefin??t di GTK" +#: Adwaita-dark.xml:22 Adwaita.xml:22 +msgid "An style scheme for Adwaita" +msgstr "Un scheme di st??l par Adwaita" #. (itstool) path: Adwaita.xml/style-scheme@_name #: Adwaita.xml:20 msgid "Adwaita" msgstr "Adwaita" -#. (itstool) path: style-scheme/_description -#: Adwaita.xml:22 -msgid "A color scheme matching GTK's default theme" -msgstr "Un scheme di col??rs che al coinc??t cul teme predefin??t di GTK" - #. (itstool) path: classic-dark.xml/style-scheme@_name #: classic-dark.xml:22 msgid "Classic Dark" @@ -334,16 +329,21 @@ msgid "Classic color scheme" msgstr "Scheme col??r classic" -#. (itstool) path: cobalt.xml/style-scheme@_name -#: cobalt.xml:25 -msgid "Cobalt" -msgstr "Cobalt" +#. (itstool) path: cobalt-light.xml/style-scheme@_name +#: cobalt-light.xml:20 +msgid "Cobalt Light" +msgstr "Cobalt cl??r" #. (itstool) path: style-scheme/_description -#: cobalt.xml:27 +#: cobalt-light.xml:22 cobalt.xml:27 msgid "Blue based color scheme" msgstr "Scheme col??r bas??t sul blu" +#. (itstool) path: cobalt.xml/style-scheme@_name +#: cobalt.xml:25 +msgid "Cobalt" +msgstr "Cobalt" + #. (itstool) path: style-scheme/_description #: kate-dark.xml:24 msgid "Dark color scheme used in the Kate text editor" @@ -355,12 +355,12 @@ msgstr "Scheme col??r dopr??t tal edit??r di test Kate" #. (itstool) path: oblivion.xml/style-scheme@_name -#: oblivion.xml:24 +#: oblivion.xml:23 msgid "Oblivion" msgstr "Oblivion" #. (itstool) path: style-scheme/_description -#: oblivion.xml:27 +#: oblivion.xml:25 msgid "Dark color scheme using the Tango color palette" msgstr "Scheme col??r sc??r doprant la palete dai col??rs Tango" @@ -394,11 +394,11 @@ msgid "Color scheme using Tango color palette" msgstr "Scheme col??r doprant la palete dai col??rs Tango" -#: gtksourceview/completion-providers/snippets/gtksourcecompletionsnippets.c:409 +#: gtksourceview/completion-providers/snippets/gtksourcecompletionsnippets.c:407 msgid "Snippets" msgstr "Snippets" -#: gtksourceview/completion-providers/words/gtksourcecompletionwords.c:317 +#: gtksourceview/completion-providers/words/gtksourcecompletionwords.c:222 msgid "Document Words" msgstr "Peraulis dal document" @@ -501,119 +501,119 @@ msgid "Missing main language definition (id = ???%s???)." msgstr "E mancje la definizion de lenghe princip??l (id = \"%s\")." -#: gtksourceview/gtksourceencoding.c:137 gtksourceview/gtksourceencoding.c:180 -#: gtksourceview/gtksourceencoding.c:182 gtksourceview/gtksourceencoding.c:184 -#: gtksourceview/gtksourceencoding.c:186 gtksourceview/gtksourceencoding.c:188 -#: gtksourceview/gtksourceencoding.c:190 gtksourceview/gtksourceencoding.c:192 +#: gtksourceview/gtksourceencoding.c:136 gtksourceview/gtksourceencoding.c:179 +#: gtksourceview/gtksourceencoding.c:181 gtksourceview/gtksourceencoding.c:183 +#: gtksourceview/gtksourceencoding.c:185 gtksourceview/gtksourceencoding.c:187 +#: gtksourceview/gtksourceencoding.c:189 gtksourceview/gtksourceencoding.c:191 msgid "Unicode" msgstr "Unicode" -#: gtksourceview/gtksourceencoding.c:151 gtksourceview/gtksourceencoding.c:175 -#: gtksourceview/gtksourceencoding.c:225 gtksourceview/gtksourceencoding.c:268 +#: gtksourceview/gtksourceencoding.c:150 gtksourceview/gtksourceencoding.c:174 +#: gtksourceview/gtksourceencoding.c:224 gtksourceview/gtksourceencoding.c:267 msgid "Western" msgstr "Ocident??l" -#: gtksourceview/gtksourceencoding.c:153 gtksourceview/gtksourceencoding.c:227 -#: gtksourceview/gtksourceencoding.c:264 +#: gtksourceview/gtksourceencoding.c:152 gtksourceview/gtksourceencoding.c:226 +#: gtksourceview/gtksourceencoding.c:263 msgid "Central European" msgstr "Europeane centr??l" -#: gtksourceview/gtksourceencoding.c:155 +#: gtksourceview/gtksourceencoding.c:154 msgid "South European" msgstr "Sud europeane" -#: gtksourceview/gtksourceencoding.c:157 gtksourceview/gtksourceencoding.c:171 -#: gtksourceview/gtksourceencoding.c:278 +#: gtksourceview/gtksourceencoding.c:156 gtksourceview/gtksourceencoding.c:170 +#: gtksourceview/gtksourceencoding.c:277 msgid "Baltic" msgstr "Baltiche" -#: gtksourceview/gtksourceencoding.c:159 gtksourceview/gtksourceencoding.c:229 -#: gtksourceview/gtksourceencoding.c:242 gtksourceview/gtksourceencoding.c:246 -#: gtksourceview/gtksourceencoding.c:248 gtksourceview/gtksourceencoding.c:266 +#: gtksourceview/gtksourceencoding.c:158 gtksourceview/gtksourceencoding.c:228 +#: gtksourceview/gtksourceencoding.c:241 gtksourceview/gtksourceencoding.c:245 +#: gtksourceview/gtksourceencoding.c:247 gtksourceview/gtksourceencoding.c:265 msgid "Cyrillic" msgstr "Ciriliche" -#: gtksourceview/gtksourceencoding.c:161 gtksourceview/gtksourceencoding.c:235 -#: gtksourceview/gtksourceencoding.c:276 +#: gtksourceview/gtksourceencoding.c:160 gtksourceview/gtksourceencoding.c:234 +#: gtksourceview/gtksourceencoding.c:275 msgid "Arabic" msgstr "Arabe" -#: gtksourceview/gtksourceencoding.c:163 gtksourceview/gtksourceencoding.c:270 +#: gtksourceview/gtksourceencoding.c:162 gtksourceview/gtksourceencoding.c:269 msgid "Greek" msgstr "Greche" -#: gtksourceview/gtksourceencoding.c:165 +#: gtksourceview/gtksourceencoding.c:164 msgid "Hebrew Visual" msgstr "Ebraiche visu??l" -#: gtksourceview/gtksourceencoding.c:167 gtksourceview/gtksourceencoding.c:231 -#: gtksourceview/gtksourceencoding.c:272 +#: gtksourceview/gtksourceencoding.c:166 gtksourceview/gtksourceencoding.c:230 +#: gtksourceview/gtksourceencoding.c:271 msgid "Turkish" msgstr "Turche" -#: gtksourceview/gtksourceencoding.c:169 +#: gtksourceview/gtksourceencoding.c:168 msgid "Nordic" msgstr "Nordiche" -#: gtksourceview/gtksourceencoding.c:173 +#: gtksourceview/gtksourceencoding.c:172 msgid "Celtic" msgstr "Celtiche" -#: gtksourceview/gtksourceencoding.c:177 +#: gtksourceview/gtksourceencoding.c:176 msgid "Romanian" msgstr "Rumene" -#: gtksourceview/gtksourceencoding.c:195 +#: gtksourceview/gtksourceencoding.c:194 msgid "Armenian" msgstr "Armene" -#: gtksourceview/gtksourceencoding.c:197 gtksourceview/gtksourceencoding.c:199 -#: gtksourceview/gtksourceencoding.c:213 +#: gtksourceview/gtksourceencoding.c:196 gtksourceview/gtksourceencoding.c:198 +#: gtksourceview/gtksourceencoding.c:212 msgid "Chinese Traditional" msgstr "Cinese tradizion??l" -#: gtksourceview/gtksourceencoding.c:201 +#: gtksourceview/gtksourceencoding.c:200 msgid "Cyrillic/Russian" msgstr "Ciriliche/Russe" -#: gtksourceview/gtksourceencoding.c:204 gtksourceview/gtksourceencoding.c:206 -#: gtksourceview/gtksourceencoding.c:208 gtksourceview/gtksourceencoding.c:238 -#: gtksourceview/gtksourceencoding.c:253 +#: gtksourceview/gtksourceencoding.c:203 gtksourceview/gtksourceencoding.c:205 +#: gtksourceview/gtksourceencoding.c:207 gtksourceview/gtksourceencoding.c:237 +#: gtksourceview/gtksourceencoding.c:252 msgid "Japanese" msgstr "Gjaponese" -#: gtksourceview/gtksourceencoding.c:211 gtksourceview/gtksourceencoding.c:240 -#: gtksourceview/gtksourceencoding.c:244 gtksourceview/gtksourceencoding.c:259 +#: gtksourceview/gtksourceencoding.c:210 gtksourceview/gtksourceencoding.c:239 +#: gtksourceview/gtksourceencoding.c:243 gtksourceview/gtksourceencoding.c:258 msgid "Korean" msgstr "Coreane" -#: gtksourceview/gtksourceencoding.c:216 gtksourceview/gtksourceencoding.c:218 -#: gtksourceview/gtksourceencoding.c:220 +#: gtksourceview/gtksourceencoding.c:215 gtksourceview/gtksourceencoding.c:217 +#: gtksourceview/gtksourceencoding.c:219 msgid "Chinese Simplified" msgstr "Cinese semplificade" -#: gtksourceview/gtksourceencoding.c:222 +#: gtksourceview/gtksourceencoding.c:221 msgid "Georgian" msgstr "Gjeorgjiane" -#: gtksourceview/gtksourceencoding.c:233 gtksourceview/gtksourceencoding.c:274 +#: gtksourceview/gtksourceencoding.c:232 gtksourceview/gtksourceencoding.c:273 msgid "Hebrew" msgstr "Ebraiche" -#: gtksourceview/gtksourceencoding.c:250 +#: gtksourceview/gtksourceencoding.c:249 msgid "Cyrillic/Ukrainian" msgstr "Ciriliche/Ucraine" -#: gtksourceview/gtksourceencoding.c:255 gtksourceview/gtksourceencoding.c:261 -#: gtksourceview/gtksourceencoding.c:280 +#: gtksourceview/gtksourceencoding.c:254 gtksourceview/gtksourceencoding.c:260 +#: gtksourceview/gtksourceencoding.c:279 msgid "Vietnamese" msgstr "Vietnamite" -#: gtksourceview/gtksourceencoding.c:257 +#: gtksourceview/gtksourceencoding.c:256 msgid "Thai" msgstr "Tailandese" -#: gtksourceview/gtksourceencoding.c:491 +#: gtksourceview/gtksourceencoding.c:485 msgid "Unknown" msgstr "No cognossude" @@ -631,11 +631,11 @@ #. * for a list of supported encodings. #. * Keep the same format: square brackets, single quotes, commas. #. -#: gtksourceview/gtksourceencoding.c:635 +#: gtksourceview/gtksourceencoding.c:628 msgid "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" msgstr "['UTF-8', 'CURRENT', 'ISO-8859-15', 'UTF-16']" -#: gtksourceview/gtksourcefileloader.c:506 +#: gtksourceview/gtksourcefileloader.c:502 msgid "" "There was a character encoding conversion error and it was needed to use a " "fallback character." @@ -643,35 +643,34 @@ "Si ?? verific??t un er??r tal convert?? la codifiche dai caratars e al ?? st??t " "necessari dopr?? un caratar di repe??." -#: gtksourceview/gtksourcefileloader.c:613 +#: gtksourceview/gtksourcefileloader.c:617 msgid "File too big." msgstr "File masse grant." -#: gtksourceview/gtksourcefileloader.c:767 +#: gtksourceview/gtksourcefileloader.c:772 msgid "Not a regular file." msgstr "Nol ?? un file regol??r." -#: gtksourceview/gtksourcefilesaver.c:966 +#: gtksourceview/gtksourcefilesaver.c:962 msgid "The file is externally modified." msgstr "Il file al ?? modific??t di dif??r di chi." -#: gtksourceview/gtksourcefilesaver.c:1422 +#: gtksourceview/gtksourcefilesaver.c:1402 msgid "The buffer contains invalid characters." msgstr "Il buffer al conten caratars no valits." #. * -#. * SECTION:language -#. * @Short_description: Represents a syntax highlighted language -#. * @Title: GtkSourceLanguage -#. * @See_also: #GtkSourceLanguageManager +#. * GtkSourceLanguage: +#. * +#. * Represents a syntax highlighted language. #. * -#. * A #GtkSourceLanguage represents a programming or markup language, affecting -#. * syntax highlighting and [context classes][context-classes]. +#. * A `GtkSourceLanguage` represents a programming or markup language, affecting +#. * syntax highlighting and [context classes](./class.Buffer.html#context-classes). #. * -#. * Use #GtkSourceLanguageManager to obtain a #GtkSourceLanguage instance, and -#. * gtk_source_buffer_set_language() to apply it to a #GtkSourceBuffer. +#. * Use [class@LanguageManager] to obtain a `GtkSourceLanguage` instance, and +#. * [method@Buffer.set_language] to apply it to a [class@Buffer]. #. -#: gtksourceview/gtksourcelanguage.c:53 +#: gtksourceview/gtksourcelanguage.c:52 msgid "Others" msgstr "Altris" @@ -690,35 +689,35 @@ msgstr "l'??s di \\C nol ?? supuart??t tes definizions dal lenga??" #. TODO: have a ChooserDialog? -#: gtksourceview/gtksourcestyleschemechooserbutton.c:181 +#: gtksourceview/gtksourcestyleschemechooserbutton.c:178 msgid "Select a Style" msgstr "Selezione un st??l" -#: gtksourceview/gtksourcestyleschemechooserbutton.c:185 +#: gtksourceview/gtksourcestyleschemechooserbutton.c:182 msgid "_Cancel" msgstr "_Anule" -#: gtksourceview/gtksourcestyleschemechooserbutton.c:186 +#: gtksourceview/gtksourcestyleschemechooserbutton.c:183 msgid "_Select" msgstr "_Selezione" -#: gtksourceview/gtksourceview.c:1825 +#: gtksourceview/gtksourceview.c:1806 msgid "All _Upper Case" msgstr "Dut _maiuscul" -#: gtksourceview/gtksourceview.c:1829 +#: gtksourceview/gtksourceview.c:1810 msgid "All _Lower Case" msgstr "Dut mi_nuscul" -#: gtksourceview/gtksourceview.c:1833 +#: gtksourceview/gtksourceview.c:1814 msgid "_Invert Case" msgstr "_Invert??s maiusculis/minusculis" -#: gtksourceview/gtksourceview.c:1837 +#: gtksourceview/gtksourceview.c:1818 msgid "_Title Case" msgstr "Capitalizazion dal _titul" -#: gtksourceview/gtksourceview.c:1841 +#: gtksourceview/gtksourceview.c:1822 msgid "C_hange Case" msgstr "_Cambie capitalizazion" @@ -763,6 +762,32 @@ msgid "Error while parsing replacement text ???%s??? at char %lu: %s" msgstr "Er??r tal analiz?? il test di sostituzion ???%s??? al caratar %lu: %s" +#: gtksourceview/vim/gtksourceviminsert.c:489 +msgid "-- INSERT --" +msgstr "-- INSERZION --" + +#: gtksourceview/vim/gtksourcevimreplace.c:125 +msgid "-- REPLACE --" +msgstr "-- SOSTITUZION --" + +#: gtksourceview/vim/gtksourcevimvisual.c:299 +msgid "-- VISUAL --" +msgstr "-- VISU??L --" + +#: gtksourceview/vim/gtksourcevimvisual.c:302 +msgid "-- VISUAL LINE --" +msgstr "-- VISU??L LINIE --" + +#: gtksourceview/vim/gtksourcevimvisual.c:305 +msgid "-- VISUAL BLOCK --" +msgstr "-- VISU??L BLOC --" + +#~ msgid "A dark color scheme matching GTK's default theme" +#~ msgstr "Un scheme di col??rs sc??rs che al coinc??t cul teme predefin??t di GTK" + +#~ msgid "A color scheme matching GTK's default theme" +#~ msgstr "Un scheme di col??rs che al coinc??t cul teme predefin??t di GTK" + #~ msgid "All" #~ msgstr "Dutis" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/tests/syntax-highlighting/file.pl new/gtksourceview-5.4.2/tests/syntax-highlighting/file.pl --- old/gtksourceview-5.4.1/tests/syntax-highlighting/file.pl 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/tests/syntax-highlighting/file.pl 2022-06-12 19:45:06.705907000 +0200 @@ -102,16 +102,51 @@ } until /^\s+$/; } +=pod + =head1 EXAMPLE + B<collateindex.pl> B<-o> F<index.sgml> F<HTML.index> + =head1 EXIT STATUS + =over 5 + =item B<0> Success + =item B<1> Failure + =back + =head1 AUTHOR + Norm Walsh E<lt>n...@nwalsh.come<gt> Minor updates by Adam Di Carlo E<lt>a...@onshore.come<gt> and Peter Eisentraut E<lt>pete...@gmx.nete<gt> + +=begin html +<!-- +This is raw data ignored by POD processors. +=end not_the_end =cut +--> +=end html + +Still POD. + +=cut + +sub end { +=pod + +Here's another snippet of valid C<POD>. + +=cut + + my $foo = { bar => \*STDOUT }; +} + +__END__ + +if present, this data isn't supposed to be processed as Perl. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/testsuite/test-language.c new/gtksourceview-5.4.2/testsuite/test-language.c --- old/gtksourceview-5.4.1/testsuite/test-language.c 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/testsuite/test-language.c 2022-06-12 19:45:06.709907000 +0200 @@ -78,26 +78,53 @@ { } +static int +sort_strv_strcmpptr (gconstpointer a, + gconstpointer b, + gpointer user_data) +{ + const char *stra = *(const char **)a; + const char *strb = *(const char **)b; + + return g_strcmp0 (stra, strb); +} + +static char ** +sort_strv (const char * const *strv) +{ + char **copy = g_strdupv ((char **)strv); + gsize n_elements = g_strv_length (copy); + g_qsort_with_data (copy, n_elements, sizeof (char *), sort_strv_strcmpptr, NULL); + return copy; +} + static void -compare_strv_unordered (const gchar **strv, - const gchar **expected_strv) +compare_strv_unordered (const gchar * const *strv, + const gchar * const *expected_strv) { - if (expected_strv != NULL) + char **strv_sorted; + char **expected_strv_sorted; + + if (expected_strv == NULL) { - guint i; + g_assert_true (strv == NULL || strv[0] == NULL); + return; + } - g_assert_cmpuint (g_strv_length ((gchar **) strv), ==, - g_strv_length ((gchar **) expected_strv)); + g_assert_nonnull (strv); - for (i = 0; expected_strv[i] != NULL; i++) - { - g_assert_true (g_strv_contains (strv, expected_strv[i])); - } - } - else + g_assert_cmpint (g_strv_length ((char **)strv), ==, g_strv_length ((char **)expected_strv)); + + strv_sorted = sort_strv (strv); + expected_strv_sorted = sort_strv (strv); + + for (guint i = 0; strv_sorted[i]; i++) { - g_assert_null (strv); + g_assert_cmpstr (strv_sorted[i], ==, expected_strv_sorted[i]); } + + g_strfreev (strv_sorted); + g_strfreev (expected_strv_sorted); } static void diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gtksourceview-5.4.1/testsuite/test-vim-input.c new/gtksourceview-5.4.2/testsuite/test-vim-input.c --- old/gtksourceview-5.4.1/testsuite/test-vim-input.c 2022-04-21 22:17:09.000000000 +0200 +++ new/gtksourceview-5.4.2/testsuite/test-vim-input.c 2022-06-12 19:45:06.710907000 +0200 @@ -26,6 +26,7 @@ #include <gtksourceview/vim/gtksourcevimcommand.h> #include <gtksourceview/vim/gtksourceviminsert.h> #include <gtksourceview/vim/gtksourcevimnormal.h> +#include <gtksourceview/vim/gtksourcevimregisters.h> #include <gtksourceview/vim/gtksourcevimstate.h> static void @@ -38,9 +39,13 @@ GtkSourceStyleSchemeManager *schemes = gtk_source_style_scheme_manager_get_default (); GtkSourceStyleScheme *scheme = gtk_source_style_scheme_manager_get_scheme (schemes, "Adwaita"); GtkSourceVim *vim = gtk_source_vim_new (view); + GtkSourceVimState *registers = gtk_source_vim_state_get_registers (GTK_SOURCE_VIM_STATE (vim)); GtkTextIter begin, end; char *ret; + /* Registers are shared per-process, so they need to be reset between runs */ + gtk_source_vim_registers_reset (GTK_SOURCE_VIM_REGISTERS (registers)); + gtk_source_buffer_set_style_scheme (buffer, scheme); gtk_text_buffer_set_text (GTK_TEXT_BUFFER (buffer), text, -1);