How to reproduce: Create a plain text file which contains more lines of text than the window is able to show without scrolling. Now call the search (Strg + F in my case, with other keyboads I assume it is Ctrl + F). Type in a word which is only available in the last line. Until now everthing works fine. Close the search whithout deleting the keyword, scroll to the top and and call the search again. Voilà, the match cannot been seen and you aren't able to scroll to it. Furthermore the match will not be highlighted which is another little bug I think. How do I know this when the match is not visible at all? Try the same but search for a string which is available in the first line. Close the search without deleting the keyword, scroll to the bottom and call the search again. The match is now visible but not highlighted. I think the match should be highlighted because the view jumps to it. I am using Xubuntu 18.10 64 bit. Let me know when I should create another bug for the missing highlighting.
Created attachment 9200 patch This seems to be a timing issue which can be fixed by not letting Mousepad scroll to the search result occurrence immediately, but when idle.
Many thanks. The patch works fine for me. The match is now visible but not highlighted (see description above). Should I create another bug for this issue?
Created attachment 9223 diff Sorry that I ignored the second part. When one opens the search bar, it selects/marks the text in the input field. This removes any highlight in the document. The attached diff disables this behavior.
Wonderful. Also second patch works like a charm.
Maybe it's just me but, without the second patch (in Comment 3) my PRIMARY selection (aka that shift+insert or MMB clipboard) is overwritten with the text selected from the search bar, because gtk3 (apparently) is overwriting it when selection happens. Also, given the name of this clipboard(PRIMARY selection), it makes sense that would happen. But compared to how notepad/word in Windows does it, you'd expect the text you selected inside the editor to not be lost when find bar opens. With that in mind, I had to patch both gtk3 and mousepad. gtk3 so that xfce4-terminal(and likely others) which just use focus like terminal/terminal-search-dialog.c:367: gtk_widget_grab_focus (dialog->entry); which gtk3 makes it so that all text is selected (unless 'gtk-entry-select-on-focus' isn't set, and it is by default), and gtk3 will copy to PRIMARY selection any text selection (even if automatic, ie. non-human generated) gtk3 patch is like this: diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index db93ee1baa..4829e03192 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -5055,22 +5055,22 @@ static void gtk_entry_grab_focus (GtkWidget *widget) { GtkEntry *entry = GTK_ENTRY (widget); - GtkEntryPrivate *priv = entry->priv; - gboolean select_on_focus; - - if (priv->editable && !priv->in_click) - { - g_object_get (gtk_widget_get_settings (widget), - "gtk-entry-select-on-focus", - &select_on_focus, - NULL); - - _gtk_entry_grab_focus (entry, select_on_focus); - } - else - { +// GtkEntryPrivate *priv = entry->priv; +// gboolean select_on_focus; +// +// if (priv->editable && !priv->in_click) +// { +// g_object_get (gtk_widget_get_settings (widget), +// "gtk-entry-select-on-focus", +// &select_on_focus, +// NULL); +// +// _gtk_entry_grab_focus (entry, select_on_focus); +// } +// else +// { _gtk_entry_grab_focus (entry, FALSE); - } +// } } /**
-- GitLab Migration Automatic Message -- This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/apps/mousepad/-/issues/26. Please create an account or use an existing account on one of our supported OAuth providers. If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev