From 381bba216a83d2c30bf46b5c7d52d7a1404b9d40 Mon Sep 17 00:00:00 2001 From: Sergio Hernandez Reyes Date: Thu, 4 Aug 2022 00:07:50 -0500 Subject: [PATCH] Compatibility with GtkSourceView-4 --- configure.ac | 2 +- src/simplEdit_search_dialog.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 97de077..fd661eb 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ IT_PROG_INTLTOOL([0.40]) GLIB_GSETTINGS PKG_CHECK_MODULES([GTK], [glib-2.0 gmodule-2.0 gtk+-3.0], , exit) -PKG_CHECK_MODULES([SOURCEVIEW], [gtksourceview-3.0], , exit) +PKG_CHECK_MODULES([SOURCEVIEW], [gtksourceview-4], , exit) # Needed by intltool GETTEXT_PACKAGE=${PACKAGE_TARNAME} diff --git a/src/simplEdit_search_dialog.c b/src/simplEdit_search_dialog.c index 4cd85a7..4b4cca3 100644 --- a/src/simplEdit_search_dialog.c +++ b/src/simplEdit_search_dialog.c @@ -102,7 +102,7 @@ void smpldt_searchdlg_clbk_search (GtkMenuItem *menuitem, gpointer user_data) { gtk_source_search_settings_set_search_text(pDialog->pSearchSettings, gtk_entry_get_text(GTK_ENTRY(pDialog->txtSearchText))); - if (gtk_source_search_context_forward2(pDialog->pSearchContext, pDialog->pStartIter, pDialog->pStartIter, pEndIter, NULL)) { + if (gtk_source_search_context_forward(pDialog->pSearchContext, pDialog->pStartIter, pDialog->pStartIter, pEndIter, NULL)) { gtk_text_buffer_move_mark_by_name(GTK_TEXT_BUFFER(pSrcBuff), "selection_bound", pDialog->pStartIter); gtk_text_buffer_move_mark_by_name(GTK_TEXT_BUFFER(pSrcBuff), "insert", pEndIter); gtk_text_iter_assign(pDialog->pStartIter, pEndIter); @@ -155,8 +155,8 @@ void smpldt_searchdlg_clbk_replace (GtkMenuItem *menuitem, gpointer user_data) { pcReplace = gtk_entry_get_text(GTK_ENTRY(pDialog->txtReplaceText)); - if (gtk_source_search_context_forward2(pDialog->pSearchContext, pDialog->pStartIter, pDialog->pStartIter, pEndIter, NULL)) { - if (gtk_source_search_context_replace2(pDialog->pSearchContext, pDialog->pStartIter, pEndIter, pcReplace, -1, &pErr)) { + if (gtk_source_search_context_forward(pDialog->pSearchContext, pDialog->pStartIter, pDialog->pStartIter, pEndIter, NULL)) { + if (gtk_source_search_context_replace(pDialog->pSearchContext, pDialog->pStartIter, pEndIter, pcReplace, -1, &pErr)) { gtk_text_buffer_move_mark_by_name(GTK_TEXT_BUFFER(pSrcBuff), "selection_bound", pDialog->pStartIter); gtk_text_buffer_move_mark_by_name(GTK_TEXT_BUFFER(pSrcBuff), "insert", pEndIter); gtk_text_iter_assign(pDialog->pStartIter, pEndIter);