Fix searching backwards from the Find dialog
search_find_prev() wasn't properly updated to work on GeanyFindFlags leading to incorrect flags handling.
This commit is contained in:
parent
0a063c1a72
commit
8812e39e2e
28
src/search.c
28
src/search.c
@ -2031,20 +2031,7 @@ static gint find_regex(ScintillaObject *sci, guint pos, GRegex *regex, GeanyMatc
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
gint search_find_prev(ScintillaObject *sci, const gchar *str, gint flags, GeanyMatchInfo **match_)
|
static gint geany_find_flags_to_sci_flags(GeanyFindFlags flags)
|
||||||
{
|
|
||||||
gint ret;
|
|
||||||
|
|
||||||
g_return_val_if_fail(! (flags & GEANY_FIND_REGEXP), -1);
|
|
||||||
|
|
||||||
ret = sci_search_prev(sci, flags, str);
|
|
||||||
if (ret != -1 && match_)
|
|
||||||
*match_ = match_info_new(flags, ret, ret + strlen(str));
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static gint geany_find_flags_to_sci_flags(gint flags)
|
|
||||||
{
|
{
|
||||||
g_warn_if_fail(! (flags & GEANY_FIND_MULTILINE));
|
g_warn_if_fail(! (flags & GEANY_FIND_MULTILINE));
|
||||||
|
|
||||||
@ -2055,6 +2042,19 @@ static gint geany_find_flags_to_sci_flags(gint flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
gint search_find_prev(ScintillaObject *sci, const gchar *str, gint flags, GeanyMatchInfo **match_)
|
||||||
|
{
|
||||||
|
gint ret;
|
||||||
|
|
||||||
|
g_return_val_if_fail(! (flags & GEANY_FIND_REGEXP), -1);
|
||||||
|
|
||||||
|
ret = sci_search_prev(sci, geany_find_flags_to_sci_flags(flags), str);
|
||||||
|
if (ret != -1 && match_)
|
||||||
|
*match_ = match_info_new(flags, ret, ret + strlen(str));
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
gint search_find_next(ScintillaObject *sci, const gchar *str, gint flags, GeanyMatchInfo **match_)
|
gint search_find_next(ScintillaObject *sci, const gchar *str, gint flags, GeanyMatchInfo **match_)
|
||||||
{
|
{
|
||||||
GeanyMatchInfo *match;
|
GeanyMatchInfo *match;
|
||||||
|
@ -2332,7 +2332,7 @@ static void on_find_usage(GtkWidget *widget, G_GNUC_UNUSED gpointer unused)
|
|||||||
if (widget == symbol_menu.find_in_files)
|
if (widget == symbol_menu.find_in_files)
|
||||||
search_show_find_in_files_dialog_full(tag->name, NULL);
|
search_show_find_in_files_dialog_full(tag->name, NULL);
|
||||||
else
|
else
|
||||||
search_find_usage(tag->name, tag->name, SCFIND_WHOLEWORD | SCFIND_MATCHCASE,
|
search_find_usage(tag->name, tag->name, GEANY_FIND_WHOLEWORD | GEANY_FIND_MATCHCASE,
|
||||||
widget == symbol_menu.find_usage);
|
widget == symbol_menu.find_usage);
|
||||||
|
|
||||||
tm_tag_unref(tag);
|
tm_tag_unref(tag);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user