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 742046 - Enter key should not simultaneously cause search results to jump and also close search box
Enter key should not simultaneously cause search results to jump and also clo...
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on: 742044
Blocks:
 
 
Reported: 2014-12-28 03:15 UTC by Michael Catanzaro
Modified: 2014-12-31 14:39 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Catanzaro 2014-12-28 03:15:36 UTC
After typing the text of a search (Ctrl+Shift+F), pressing the Enter key causes the view to shift to the next occurrence of the search result in the editor view, and closes the search box. The search should not be closed by the same key that causes the view to jump, since the user cannot know if he is done searching before he has seen the search result. It would be better if pressing Enter simply closed the search without jumping the editor view, as in gedit.

This should probably not be changed unless my suggestion in bug #742044 is also implemented.
Comment 1 Christian Hergert 2014-12-28 11:42:03 UTC
I want to maintain the workflow of:

 <Control>F searchterm Return

to jump to the next search result. I do, however, want to opportunistically start scrolling to the next match as keys are pressed. And then if Escape is pressed to cancel the search, we unwind the scrolling to return to the previous position. (Equivalent to "set incsearch" in VIM).
Comment 2 Michael Catanzaro 2014-12-28 15:30:20 UTC
(In reply to comment #1)
> I want to maintain the workflow of:
> 
>  <Control>F searchterm Return
> 
> to jump to the next search result.

I guess Return is a natural key to use to go to the next result. I don't think there would be anything wrong with using Return to jump to the next result if it did not also close the search box. The problem is that I'm not sure what other key would be natural to use to close the search box.

The reason I'm not enamored with the current workflow is that I don't want to complete the search before I can see the line of code I'll wind up on. If Return jumps to the next result and also closes the search box, as it does now, and I'm not satisfied with where I've wound up, then I have to press Ctrl+F again to continue the search, which is undesirable compared to using the arrow keys. With the current behavior, I never want to press Return.

(In reply to comment #1)
> And then if Escape is
> pressed to cancel the search, we unwind the scrolling to return to the previous
> position. (Equivalent to "set incsearch" in VIM).

That's actually what gedit does, and it is nice. But it would be problematic when combined with Return jumps to next result. The problem is that, after having found the line you want to end up on, there will be no obvious way to close the search with the keyboard while remaining on the current line: you would have to use the mouse to click outside the search box. (With the changes currently in master, I use Escape for this purpose. I've discovered that the Tab key works as well, but that doesn't seem ideal.) There should be an easy (non-tab) way to close the search box using just the keyboard, without jumping to a different line. If I could use Return to close the search, instead of Escape or Tab, then there would be no problem with using Escape to unwind.

hrmm...
Comment 3 Christian Hergert 2014-12-31 12:30:46 UTC
I just landed search rubberbanding in master. As you type, you will jump forward to the next matching result. If you hit escape, you will be jumped back to your previous position.

Combined with the arrow keys, I'm liking this a lot. It allows you to look ahead without losing your position. (However, moving the arrow keys does update your "last position"). Not sure how I feel about that yet.

Try it out and then let's move this discussion forward from there.
Comment 4 Christian Hergert 2014-12-31 12:31:54 UTC
Also, now that we have rubberbanding, the Enter to close the search entry feels a lot nicer, because the editor doesn't jump. It just hides the search entry.
Comment 5 Michael Catanzaro 2014-12-31 14:39:38 UTC
OK, I actually really like what you implemented: you avoided the concerns in my post above. So the original issue is resolved.