google / zoekt

Fast trigram based code search
1.67k stars 113 forks source link

built-in pages should support '/' shortcut to go to search box. #109

Closed hanwen closed 4 years ago

dziemba commented 4 years ago

Hey @hanwen, I saw that you implemented this in https://github.com/google/zoekt/commit/983e877dba55963e63ebabb4af4a2e5b8d7a2f03

It's a cool feature! Unfortunately it breaks entering the / character in the search box. That's because the event handler catches all key presses for that character, even when entering text into the text field, and then stops the event chain.

I have not tried this, but maybe it's already enough to remove the return false in the handler function, so that the event keeps propagating.

hanwen commented 4 years ago

that kind of works, but then it puts '/' in the search box too . I guess I have to 'return false' only if search box is not in focus.

hanwen commented 4 years ago

https://gerrit-review.googlesource.com/c/zoekt/+/271555

dziemba commented 4 years ago

Looks good, thanks! :+1: