Interleaved [Fri, 16 Dec 2016 09:14:43 +0000 (10:14 +0100)]
Update de locale (#845)
* Update de translation for blacklist settings
Use word "Ausnahmen" ("Exception") for the blacklist description instead of using "Schwarze Liste". It could be considered to use "Exeptions" also for the english locale.
* Update de translation for auto activation
* Add more de translations
Tabs is also used mostly in german. Sometimes the word "Registerkarten" is used for that.
Simon Lydell [Sun, 4 Dec 2016 14:48:04 +0000 (15:48 +0100)]
Fix tests in Firefox Nightly
Firefox have either moved the Assert.jsm module, or stopped exposing it.
I'm tired of that happening (it's not the first time), so I decided to
implement the small part of Assert.jsm that was actually used in VimFx's
test on my own. On the upside, this resulted in nicer error messages
when tests fail.
Simon Lydell [Sun, 13 Nov 2016 16:47:19 +0000 (17:47 +0100)]
Always place markers next to text if appropriate
For example, the hint marker for buttons with centered text are now
placed just to the left of the text rather than at the left edge of
button. This is nice because it means that hint markers usually end up
where you were just reading.
Simon Lydell [Wed, 9 Nov 2016 07:07:17 +0000 (08:07 +0100)]
Blur the location bar consistently
Refs. #831: Let's say you added the custom command that focuses the
location bar, sets its text to '% ' and opens the autocomplete popup.
You set the shortcut to `q`. If you then press `q<escape>`, you'll end
up with '% ' being left in the location bar. Usually, the location bar
is cleared when blurring it. This is because of that the autocomplete
popup is open. This commit makes sure to close the location bar
autocomplete popup before blurring, fixing the problem.
Simon Lydell [Tue, 8 Nov 2016 18:43:32 +0000 (19:43 +0100)]
Find `<label>` elements in the first pass for `f`
It is common to implement custom styled checkboxes and radiobuttons by
hiding the actual `<input>` element and style its `<label>` instead.
Therefore it makes sense to find them in the first pass, so you don't
have to wait for their labels so long. This does not seem to degrade the
performance of the first pass.
Simon Lydell [Sun, 6 Nov 2016 20:56:32 +0000 (21:56 +0100)]
Don't reset highlighted hint markers in the second pass
When injecting hint markers for the second pass, do reset which hint
markers are visually highlighted (in case they change), but _don't_
reset the actual data. Regression since commit e70ab849.
Simon Lydell [Sun, 6 Nov 2016 10:27:45 +0000 (11:27 +0100)]
Improve markable element area comparisons
Boxes that appear to be exactly the same size should be given "equally"
good hints, favoring earlier ones when needed. Sometimes, though, their
areas differ from a fraction of a pixel up to a couple of pixels.
This commits changes how the comparisons of marker weights (which
effectively are element areas), so that elements whose area differ by
less than 10px are considered to have the same area. That results in the
expected hints for same-sized boxes.
Refs. #831: The browser tabs often had this problem. At first, all tabs
could be given the expected hints: The first one getting the best one
etc. Opening a new tab, the best hint could suddenly be given to some
random tab in the middle.
Simon Lydell [Sun, 6 Nov 2016 09:33:51 +0000 (10:33 +0100)]
Improve hint marker positioning
A pixel up, down, left or right _is_ visible. Using `Math.round` goes to
the most expected pixel. Previously, markers many times appeared to be
slightly too close to the top of elements, rather than at the center.
Simon Lydell [Tue, 18 Oct 2016 15:09:57 +0000 (17:09 +0200)]
Improve full page scrolling adjustment on some pages
On medium.com, there is a fixed footer. However, it is not
`position: fixed;` like fixed element usually are. Instead, it's
`position: absolute;` (and the page scroll is inside an adjacent element
instead of on `<html>`). This commit allows elements with
`position: absolute;` to as headers and footers as well.
Simon Lydell [Tue, 18 Oct 2016 10:52:08 +0000 (12:52 +0200)]
Fix `<escape>` handling in Normal mode
When pressing `<escape>` inside a text input, `<escape>` is not supposed
to be passed on to the page (like is otherwise done), to allow blurring
text inputs inside modals without also closing the modal. There already
was logic for this, but it didn't work because the check for the
currently selected element and the running of the `<escape>` command was
run in the wrong order.
Simon Lydell [Sun, 9 Oct 2016 10:25:42 +0000 (12:25 +0200)]
Fix text input refocus issue in GNOME
Previously, using a keyboard shortcut to switch keyboard layout in GNOME
while inside a text input caused the focus of that text input to be lost
when the prevent autofocus option was enabled.
Simon Lydell [Sun, 2 Oct 2016 07:48:55 +0000 (09:48 +0200)]
Fix the `'` mark after using `''`
The `'` mark is supposed to point to the location before the last
"jump." One such jump is using the `'` mark itself (by pressing `''`).
This means that running `''` several times in a row will flip back and
forth between two locations. However, that was previously broken. `''`
took you back to the last location, but then you got stuck there. This
commit fixes that bug.
Simon Lydell [Sun, 2 Oct 2016 07:17:06 +0000 (09:17 +0200)]
Fix z-index for hint markers
The hint markers are sorted by element area before assigning their
`z-index`es. This is so that the hint markers of larger elements appear
on top of hint markers for smaller elements. However,
`marker.wrapper.area` (which is `undefined`) was accidentally used
instead of `marker.wrapper.shape.area`. This caused the sorting to
essentially do nothing (since Firefox's `.sort` is stable).
Simon Lydell [Sat, 1 Oct 2016 08:07:50 +0000 (10:07 +0200)]
Fix selection clipboard handling
This is only for systems with a "selection clipboard."
1. Copy text using one of the following methods:
- `yv<hint>`
- `av<hint>y`
- `yf<hint>` on a contenteditable element
2. Use the `p` or `P` command.
Unlike other commands that copy text to the clipboard, such as `yy` and
`v<hint>wy`, the above methods previously didn't affect the selection
clipboard. This caused the `p` and `P` commands to operate on some other
text than expected.
This commit makes sure that all commands that copy text to the clipboard
also affect the selection clipboard (in a somewhat hacky, but working,
way).
Simon Lydell [Wed, 21 Sep 2016 15:47:14 +0000 (17:47 +0200)]
Only apply `vimfx.addKeyOverrides` in Normal mode
Previously, the key overrides were applied in _all_ modes, and the
current mode name was passed as the second argument to the matching
functions. However, it was way to easy to forget to also check the mode
in the matching functions (even the documentation forgot to!). For
example, if you added `j` as an override for some page, you then
couldn't press `j` in Hints mode to match a hint marker.
This commit fixes this problem by simply _only_ applying the key
overrides in Normal mode. I can't think of any use cases for wanting key
overrides in any other mode.
Simon Lydell [Wed, 21 Sep 2016 06:51:03 +0000 (08:51 +0200)]
Improve scrolling when holding h/l/j/k down
When you hold an arrow key down, the scrolling is sped up. With this
commit, the `h`, `l`, `j` and `k` do too, to be as close the the arrow
keys as possible.
Note that this includes a minor breaking API change: The object passed
to modes' `onInput`, and thus the object passed to commands, no longer
has the `uiEvent` property. Instead, there's an `event` property, which
_always_ is an `Event`. `vim.isUIEvent(event)` can be used to check if
it is a UI event or not.
Simon Lydell [Sat, 17 Sep 2016 09:20:05 +0000 (11:20 +0200)]
Clarify the suggested blacklist pattern for `gB`
Clarify that the added pattern has not been saved yet, so that people
understand that the can simply dismiss the modal if they don't want to
edit the blacklist after all, without having to erase the added pattern
first.
Simon Lydell [Sat, 17 Sep 2016 09:14:52 +0000 (11:14 +0200)]
Don't use wildcards with full URLs in the `gB` command
If there is no `location.host` available, such as for `about:*` and
`file://` pages, the _entire_ URL is used instead for the suggested
blacklist addition in the `gB` command. With this commit, such entire
URLs are no longer wrapped in `*` wildcards, as it makes no sense.
Simon Lydell [Thu, 15 Sep 2016 15:11:50 +0000 (17:11 +0200)]
Always treat the hint chars' case as-is
Since filtering hint markers by element text isn't available for the
`eb` command, the hint chars were previously treated as case insensitive
for that command. Similarly, they were also treated as case insensitive
when disabling the `hints.match_text` option.
However, the above led to numerous bugs. This commit simply gets rid of
that behavior, and keeps the hint chars consistent across all `f`
commands and options instead.
Simon Lydell [Wed, 14 Sep 2016 16:52:24 +0000 (18:52 +0200)]
Simplify styling for highlighted markers
Let's try _only_ changing the background color, to bright green. This
particular green does stand out compared to other markers, and does not
obscure the text, in my opinion. Green is also commonly associated with
success -- in this case, having successfully filtered your way to a
specific link.
To make the above easier, I replaced the border and matched-char colors
with semi-transparent black, so that they work on the green background
as well.
Simon Lydell [Wed, 14 Sep 2016 16:15:56 +0000 (18:15 +0200)]
Properly suppress keys and notifications in all modes
- Many modes previously forgot to suppress when getting a partial match
for a command.
- Caret mode no correctly suppresses when entering a count.
- Ignore mode and Hints mode now explicitly make sure that notifications
for counts are not shown in their `onInput` methods.
- The keys you've entered so far when filtering hint markers by element
text now properly re-appear after the keys of a partial command match
have been cleared due to the `timeout` option.
- `EnteredKeysManager` has been removed from events.coffee and has been
merged into `Vim`, which turned out to be a nice refactor.
Simon Lydell [Wed, 14 Sep 2016 16:12:36 +0000 (18:12 +0200)]
Fix a case of being unable to filter hints by text
1. Disable the `hints.auto_activate` option.
2. Press `f`.
3. Filter hint markers by element text until only one link matches.
4. Press `<backspace>`.
5. Try to filter by element text again.
Result: Nothing happens. Previously, we got stuck in the `isMatched`
mode after deleting a typed char.
Simon Lydell [Wed, 14 Sep 2016 06:12:56 +0000 (08:12 +0200)]
Improve hint marker styling
- Increase contrast between the hint chars and the background color by
changing the text color to fully black.
- Make the styling for hint markers for scrollable elements scale with
the font size.
- Make highlighted hint markers more prominent. The changes in commit 4bb0b56c made the difference _too_ subtle. While it looked pretty good
on the computer I developed it on, the highlighting was almost
invisible on a different screen. The new styling relies not solely on
color, but also on border-radius, to increase the visual difference.
Simon Lydell [Tue, 13 Sep 2016 16:29:09 +0000 (18:29 +0200)]
Improve Hints mode in various ways
- After having filtered hint markers by at least one character, select
the entire text for the highlighted markers' elements. This makes it
way easier to notice that you can stop typing and press `<enter>`
instead to activate your desired hint marker.
- Because of the above point, it is now less important to make the
highlighted hint markers stand out very much compared to other
markers. So the styling has been changed to a more modest
highlighting.
- Fixed: Links with the same href weren't getting the same hint after
filtering hint markers by element text.
- Improved: After having filtered hint markers by element text, sort the
markers by element text length, rather than element area. A large
element might have less text than a smaller element.
- Improved: Don't allow typing more non-hint chars when all remaining
markers have the same hint. This means less backspacing for the user
in case of typos.
- Fixed: After having filtered hint markers by element text until all
remaining markers have the same hint, _any_ hint char would activate
the hint markers, even if that one didn't match the hint.
Simon Lydell [Tue, 13 Sep 2016 06:47:46 +0000 (08:47 +0200)]
Improve hints after filtering by one element text char
1. Go to Reddit or Hackernews.
2. Press `f`.
3. Filter by one common element text character, such as "e".
Previously, that resulted in really terrible hints for most (of the
larger) elements. Basically, the difference in weight used for the
elements was so large, that all hint chars except the last were used as
single-char hints for the highest-weight elements. The same thing
happened for the hints starting with the last hint char; all hint chars
except the last were used for two-char hints. This resulted in some
really terrible hints like "VVVS". This looked very broken.
With this commit, the smallest elements still get the best hints after
filtering by element text, but the difference in the hints is not that
large.
Simon Lydell [Mon, 12 Sep 2016 06:52:59 +0000 (08:52 +0200)]
Improve `gB` UX
If the page is _not_ blacklisted, everything stays the same.
If the page _is_ blacklisted, all matching blacklist patterns are moved
first and are delimited from all other patterns with several spaces.
There is also a new message for this case.