After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768812 - editor-frame: Add squiggly underlines for invalid regex
editor-frame: Add squiggly underlines for invalid regex
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-07-14 16:12 UTC by Matthew Leeds
Modified: 2016-07-14 18:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
editor-frame: Move the logic for enabling/disabling replace actions (9.54 KB, patch)
2016-07-14 16:12 UTC, Matthew Leeds
accepted-commit_now Details | Review
editor-frame: Add squiggly underlines for invalid regex (5.10 KB, patch)
2016-07-14 16:12 UTC, Matthew Leeds
accepted-commit_now Details | Review

Description Matthew Leeds 2016-07-14 16:12:25 UTC
.
Comment 1 Matthew Leeds 2016-07-14 16:12:29 UTC
Created attachment 331515 [details] [review]
editor-frame: Move the logic for enabling/disabling replace actions

There are many different conditions that determine whether Replace or
Replace All operations would make sense, so similar logic needs to be
run in many callbacks to try to ensure the buttons' sensitivity reflects
the state of the search. This commit centralizes that logic into
update_replace_actions_sensitivity() which makes the code more
maintainable.
Comment 2 Matthew Leeds 2016-07-14 16:12:33 UTC
Created attachment 331516 [details] [review]
editor-frame: Add squiggly underlines for invalid regex

When an invalid regex is entered in the search entry field, it's
difficult for the user to tell if there's an issue with their input or
if the search genuinely returned no results. This commit addresses that
ambiguity by adding a wavy underline when an invalid regular expression
is entered in the search field, or an invalid replacement string is
entered in the replace field (which can contain backreferences). The
color white is used so that it can still be seen when the background
is red (which happens when a search returns no results).
Comment 3 Christian Hergert 2016-07-14 18:13:53 UTC
Review of attachment 331515 [details] [review]:

LGTM, nice work
Comment 4 Christian Hergert 2016-07-14 18:16:11 UTC
Review of attachment 331516 [details] [review]:

Cool!
Comment 5 Matthew Leeds 2016-07-14 18:56:01 UTC
Pushed as commit 302278e573f667d6f10c67f09644a3f1a670f276 and commit e8d39eeabb9f940f2e5aa2003b8021470bfc6255