diff --git a/0001-snippets-plugin-use-gtk_source_file_get_location.patch b/0001-snippets-plugin-use-gtk_source_file_get_location.patch new file mode 100644 index 0000000..9e511ae --- /dev/null +++ b/0001-snippets-plugin-use-gtk_source_file_get_location.patch @@ -0,0 +1,55 @@ +From b91cb9aa9b56fae74942912adc51d15c80ae979b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=A9bastien=20Wilmet?= +Date: Thu, 19 Mar 2020 12:04:24 +0100 +Subject: [PATCH] snippets plugin: use gtk_source_file_get_location() + +Not gedit_document_get_location() which was deprecated and then removed. + +Fixes https://gitlab.gnome.org/GNOME/gedit/issues/272 +--- + plugins/snippets/snippets/document.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/plugins/snippets/snippets/document.py b/plugins/snippets/snippets/document.py +index eb20225e1..19dcf696b 100644 +--- a/plugins/snippets/snippets/document.py ++++ b/plugins/snippets/snippets/document.py +@@ -438,7 +438,7 @@ class Document(GObject.Object, Gedit.ViewActivatable, Signals): + + if isinstance(toplevel, Gedit.Window): + for doc in toplevel.get_documents(): +- r = self.location_uri_for_env(doc.get_location()) ++ r = self.location_uri_for_env(doc.get_file().get_location()) + + if isinstance(r, dict): + documents_uri['utf8'].append(r['utf8']) +@@ -457,7 +457,7 @@ class Document(GObject.Object, Gedit.ViewActivatable, Signals): + + if isinstance(toplevel, Gedit.Window): + for doc in toplevel.get_documents(): +- r = self.location_path_for_env(doc.get_location()) ++ r = self.location_path_for_env(doc.get_file().get_location()) + + if isinstance(r, dict): + documents_path['utf8'].append(r['utf8']) +@@ -497,7 +497,7 @@ class Document(GObject.Object, Gedit.ViewActivatable, Signals): + environ['utf8'][var] = v + environ['noenc'][var] = str(v) + +- self.env_add_for_location(environ, buf.get_location(), 'GEDIT_CURRENT_DOCUMENT') ++ self.env_add_for_location(environ, buf.get_file().get_location(), 'GEDIT_CURRENT_DOCUMENT') + + return environ + +@@ -881,7 +881,7 @@ class Document(GObject.Object, Gedit.ViewActivatable, Signals): + self.env_add_for_location(environ, gfile, 'GEDIT_DROP_DOCUMENT') + + buf = self.view.get_buffer() +- location = buf.get_location() ++ location = buf.get_file().get_location() + + relpath = location.get_relative_path(gfile) + +-- +2.25.1 + diff --git a/gedit.spec b/gedit.spec index e0c34b6..cfefd42 100644 --- a/gedit.spec +++ b/gedit.spec @@ -15,13 +15,18 @@ Name: gedit Epoch: 2 Version: 3.36.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Text editor for the GNOME desktop License: GPLv2+ and GFDL URL: https://wiki.gnome.org/Apps/Gedit Source0: https://download.gnome.org/sources/%{name}/3.36/%{name}-%{version}.tar.xz +# Fix snippet plugin +# https://gitlab.gnome.org/GNOME/gedit/issues/272 +# https://gitlab.gnome.org/GNOME/gedit/-/commit/b91cb9aa9b56fae74942912adc51d15c80ae979b +Patch0: 0001-snippets-plugin-use-gtk_source_file_get_location.patch + BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version} BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: pkgconfig(gsettings-desktop-schemas) @@ -91,7 +96,7 @@ to gedit. Install gedit-devel if you want to write plugins for gedit. %prep -%autosetup +%autosetup -p1 %build %meson -Dgtk_doc=true @@ -165,6 +170,9 @@ desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/org.gnome.gedit.de %{_datadir}/vala/ %changelog +* Thu Mar 19 2020 Adam Williamson - 2:3.36.0-2 +- Backport fix for snippet plugin (#272) + * Fri Mar 06 2020 Kalev Lember - 2:3.36.0-1 - Update to 3.36.0