philc / philc/vimium

Preserve trailing space when exiting custom search-engine completion

Open
#4,934 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
27k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

When a custom search engine is configured, there is currently no convenient way to use the default search/completions for a normal query that begins with its keyword.

For example, suppose you use:

maps: https://www.google.com/maps/search/%s

This is the current behavior (using underscores in place of spaces for clarity):

  • maps_ activates the custom maps search engine
  • a backspace will exit the custom search engine, returning you to maps (no space)
  • the CSE reactivates, as normal, with a subsequent space

By returning to the input without the trailing space, it is difficult to use the default completions or search engine for a query such as maps_of_london, since you are put in the same initial situation where continuing the query will immediately reactivate the CSE.

Expected behavior

When pressing backspace to exit a CSE, it should preserve the trailing space (leaving maps_ rather than maps in the example).

From there, the user could continue typing in a normal query or input another backspace (restoring maps) followed by a space to reactivate the CSE.

The existing behavior is already close to how Chromium-based browsers handle custom search engines. Preserving the trailing space would make it consistent and likely more intuitive. The corresponding interaction/behavior in Firefox is substantially different, clearing the entire keyword and space.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the custom search-engine completion behavior described in the issue, focusing on the backspace path that exits a CSE. Verify the existing interaction with a keyword such as maps:, then confirm that exiting leaves the trailing space and that subsequent typing uses normal completions without reactivating the CSE.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.