| Age | Commit message (Collapse) | Author |
|
... and fix two bugs:
- not suppressing keyup event after keyChar matched in keydown.
- we cannot check the passKeys keyChar in keyup because the key state
has changed; so we track what the next keyup response should be.
|
|
|
|
PhantomJS (2.1.1)".
URL: https://github.com/philc/vimium/issues/1944
|
|
|
|
Previously, we blocked keyboard events for a fixed 200ms.
With this PR, we continue blocking keyboard events until 150ms after the
last `keydown` or `keypress` event. So, we wait until we think the user
has stopped typing.
Fixes #1842.
|
|
|
|
|
|
JavaScript's sort function is not stable; this PR makes the sort used for filtered link hints stable.
There are two reasons for doing this:
- High-scoring hints are more likely to keep the same hint string as the user continues typing. (Currently, the hints assigned change based on the vaguaries of the non-stable sort.)
- For equal-scoring hints, we retain the visit-child-before-parent ordering (which is used to NOT match a parent's text if we have already matched that text in a child).
And, as a result of all of that, the UX is more predictable and hence better.
|
|
|
|
|
|
(Not sure when this crept in.)
We need to ensure that we always generate the same hint strings for the
same filter state. Here, we do this by always using the same mechanism
(@filterLinkHints) to set the hint strings.
|
|
Functionality wise, this is a no-op. However, since we now create a new
LinkHintsMode object on every "f", we don't need to be so careful about
resetting the state on exit.
|
|
LinkHints.init() isn't doing anything.
|
|
This is a minor re-working of #1705 from @mrmr1993.
The main changes are:
- Simplify initialisation logic.
- Always initialise Settings immediately and automatically (ie. don't
initialise Settings separately and manually in the background,
content scripts, options and tests).
- Get rid of addEventListener (it's only being used for on "load").
- Add Settings.use() in its place.
|
|
|
|
For ...
map s Vomnibar.activate keyword=g
... we verify that "g" is indeed a custom search-engine keyword before
setting it. If it is not, we output a console.log message and launch a
vanilla vomnibar. (An alternative would be to bail.)
|
|
Fix for #1554.
|
|
I haven't seen this happen, but...
It could be possible for the iframe's contents to load before this
callback is called (on nextTick), in which case the "load" callback
wouldn't be called. So we delay setting the iframe's source until
nextTick has elapsed.
|
|
This makes the behaviour consistent between custom and non-custom
searches when there is no selection in the vomnibar (omni-mode only).
Approach:
- When there is no selection in the vomnibar, we *always* send the
query to to background completer (that is, both for default
searches and for custom searches) and ask the completer to provide
only the primary suggestion. The primary suggestion is just what
you get if you append the query terms to the search URL (default or
custom). We then immediately open the first response.
The round trip for default searches isn't strictly necessary. However,
this uniform approach disentangles some nasty logic in the vomnibar when
we're trying to handle several cases (default or custom search, with or
without prompted text, with or without any suggestions at all). The
extra round trip simplifies the logic to such a great extend that it's
worth it.
|
|
|
|
|
|
We should also take a look at these tests and the assumptions they're
making. They're difficult to follow as is.
|
|
|
|
|
|
This reverts commit cfb137d515e6f214322538fdd9a8e236445b63b0.
Conflicts:
content_scripts/vimium_frontend.coffee
There are HUD initialization issues with this.
|
|
The tests are passing, but they are triggering an exception in the
initialization of the HUD. It's proving difficult to get the
initialization in the right order for both the tests and live.
This is a temporary fix...
|
|
This requires passing of an extra truthy argument in order to access the
(generally) unexpected behaviour of sometimes returning the rects of
child elements. All locations in the code that *actually* wanted this
behaviour have been updated to continue using it.
Also add a comment about the unexpected behaviour in the function
description.
|
|
https://github.com/mrmr1993/vimium into mrmr1993-exclusion-rules-pushState-and-hash
Conflicts:
content_scripts/vimium_frontend.coffee
|
|
The event listeners were registered late, potentially allowing the page
to get priority over us for key events, etc., when:
* the original URL was disabled by an exclusion rule
* the URL was changed
- without a page load (by history.pushState or modifying
location.hash), and
- the new URL isn't (completely) disabled by any exclusion rules.
This forces the event listeners to be registered even when the
current URL is disabled, to avoid this problem.
|
|
|
|
|
|
|
|
This is @mrmr1993's work from #1041.
Reload content scripts when vimium is installed or updates.
(@mrmr1993: The automatic merge was really messy (or, at least, I
couldn't figure out what was going on). Since the bulk of #1041 was
actually quite compact, I took the liberty of just copying it in. Hope
you don't mind.)
|
|
|
|
See #1495.
|
|
|
|
- add new option "GrabBackFocus"
- use chrome.storage.sync.get() to get option value
- avoid race conditions on load
- fix tests
|
|
When we exit visual mode with "y"...
"y" is a command for visual mode. Currently it clears the selection.
Because it's executed as a command, scrollIntoView is called after
running the command. Because the selection is cleared, scrollIntoView
found nothing to scroll, and was creating an error.
So we need to check whether there's anything to scroll into view, before
trying to scroll it.
Also fix mis-named file in the tests.
|
|
focusInput was getting its focus events from the handler stack. When
the handler stack was reset during tests, we lost focusInput's handler.
So we couldn't test the feature whereby focusInput has a memory (#1438).
Instead, here focusInput adds its listener directly to the window, and
we add the approriate test.
|
|
|
|
|
|
This uses phantomjs to generate keyboard events. So the events are
propagated through the regular event listeners. So we're testing the
full keyboard-event flow.
|
|
- Set up modes such that they can be re-initialised.
- Move initialisation of BadgeMode to general initialisation function.
- Add reset() method for handlerStack.
- Consistently use initializeModeState() in all tests' setup().
- Refactor focusInput tests.
- Add some more tests.
- Simplify some other tests.
Note: Clean-up of the inputFocus overlay now happens when the exit()
method is called in Mode.reset(). This eliminates most needs to
artificially bubble a keyboard event to clear the overlay.
|
|
|
|
|
|
Nicer syntax.
And we don't need those braces.
|
|
|
|
- Mainly comments.
- Rename chooseBadge to updateBadge (for consistency).
- No badge for passkeys; also fix tests.
|
|
|
|
|