]> git.gir.st - VimFx.git/log
VimFx.git
7 years agoVimFx v0.17.1 v0.17.1
Simon Lydell [Sun, 12 Jun 2016 15:16:46 +0000 (17:16 +0200)]
VimFx v0.17.1

7 years agoFix `zF` double clicking on browser elements (#757)
Alan Wu [Sun, 12 Jun 2016 08:27:17 +0000 (04:27 -0400)]
Fix `zF` double clicking on browser elements (#757)

`nsIDOMWindowUtils.dispatchDOMEventViaPresShell()` dispatches
a 'command' event automatically after a 'click' event on XUL pages.
This was causing `zF` to effectively double click on browser elements,
since VimFx also simulates a 'command' event.

Elements which suffers from this double click include but are not
limited to, the new tab button, question mark circles in the preferences
page and buttons created by the add-on sdk.

7 years agoUpdate devDependencies
Simon Lydell [Sat, 11 Jun 2016 10:32:59 +0000 (12:32 +0200)]
Update devDependencies

7 years agoFix the "URL popup" not appearing when using `zf`
Simon Lydell [Sat, 11 Jun 2016 09:40:27 +0000 (11:40 +0200)]
Fix the "URL popup" not appearing when using `zf`

7 years agoFix `zF` crashing when devtools open in Firefox 49
Simon Lydell [Sat, 11 Jun 2016 09:25:07 +0000 (11:25 +0200)]
Fix `zF` crashing when devtools open in Firefox 49

7 years ago Update it locale (#753)
Carlo Bertoldi [Wed, 8 Jun 2016 20:32:08 +0000 (22:32 +0200)]
 Update it locale (#753)

Refs. #728

7 years agoVimFx v0.17.0 v0.17.0
Simon Lydell [Wed, 8 Jun 2016 18:40:13 +0000 (20:40 +0200)]
VimFx v0.17.0

7 years agoUpdate devDependencies
Simon Lydell [Wed, 8 Jun 2016 10:34:48 +0000 (12:34 +0200)]
Update devDependencies

7 years agoFix some `require` sorting
Simon Lydell [Tue, 7 Jun 2016 07:07:04 +0000 (09:07 +0200)]
Fix some `require` sorting

7 years agoRename l10n.coffee into translate.coffee
Simon Lydell [Tue, 7 Jun 2016 06:49:29 +0000 (08:49 +0200)]
Rename l10n.coffee into translate.coffee

7 years agoSimplify some code by changing `.bind()` into `->`
Simon Lydell [Tue, 7 Jun 2016 06:37:17 +0000 (08:37 +0200)]
Simplify some code by changing `.bind()` into `->`

7 years agoReplace `@` with `this` when not used as `@keyword`
Simon Lydell [Tue, 7 Jun 2016 06:19:59 +0000 (08:19 +0200)]
Replace `@` with `this` when not used as `@keyword`

7 years agoRemove outdated comment
Simon Lydell [Tue, 7 Jun 2016 06:15:27 +0000 (08:15 +0200)]
Remove outdated comment

7 years agoIgnore counts in Ignore mode
Simon Lydell [Mon, 6 Jun 2016 15:22:42 +0000 (17:22 +0200)]
Ignore counts in Ignore mode

7 years agoAdd some comments and info for commit 5ca124b4d
Simon Lydell [Mon, 6 Jun 2016 10:30:34 +0000 (12:30 +0200)]
Add some comments and info for commit 5ca124b4d

7 years agoDispatch trusted mouse events to content page (#751)
Alan Wu [Mon, 6 Jun 2016 10:23:05 +0000 (06:23 -0400)]
Dispatch trusted mouse events to content page (#751)

Some DOM APIs need to be called from the handler of a trusted event to
work. `requestFullscreen()` and `document.execCommand('copy')` are
examples of such API.

Before this patch, VimFx dispatched mouse events using
`element.dispatchEvent()` which had the event handlers for the events
running in untrusted context. This behavior prevented hint mode from
full-screening on Youtube and copying clone addresses on Github.

This patch uses XPCOM to dispatch mouse events as trusted events to the
content page.

See also:
https://www.w3.org/TR/uievents/#trusted-events - info from the spec
https://clipboardjs.com/ - before this patch, copying doesn't work

7 years agoImprove Marks mode UX
Simon Lydell [Sun, 5 Jun 2016 17:25:50 +0000 (19:25 +0200)]
Improve Marks mode UX

- Return to Normal mode if a mark key hasn't been pressed within
  `options.timeout` milliseconds.

- Let `<escape>` return to Normal mode instead of creating or going to a
  mark named `<escape>`. Previously, if the user pressed `<escape>` as
  an attempt to exit Marks mode after accidentally pressing `m`, that
  would indeed exit Marks mode, but it would also set the `<escape>`
  mark. That meant that after that point, the user couldn't exit Marks
  mode using `<escape>` after having pressed `` ` `` without the side
  effect of scrolling to the `<escape>` mark.

- Marks mode has been hidden from the help dialog, in order not to
  clutter it with unnecessary information. While at it, Find mode was
  removed from the help dialog as well, for the same reason. Both modes
  are still available in VimFx's settings page in the Add-ons Manager,
  though.

Fixes #750.

7 years agoFix `[data-command]` being `undefined` in help dialog
Simon Lydell [Sun, 5 Jun 2016 17:24:36 +0000 (19:24 +0200)]
Fix `[data-command]` being `undefined` in help dialog

7 years agoMake the `?` command and the button _toggle_ help
Simon Lydell [Sun, 5 Jun 2016 17:01:02 +0000 (19:01 +0200)]
Make the `?` command and the button _toggle_ help

I've noticed people (including myself, sometimes) unconsciously
expecting both the `?` command and the button to _close_ the Keyboard
Shortcuts dialog if it is already open.

I don't think there's any need complicating the description of the `?`
command and the tooltip of the button to reflect this.

7 years agoImprove find commands race condition robustness
Simon Lydell [Sun, 5 Jun 2016 10:25:00 +0000 (12:25 +0200)]
Improve find commands race condition robustness

Possibly related: #749.

7 years agoFix some odd formatting in gulpfile.coffee
Simon Lydell [Thu, 2 Jun 2016 16:28:27 +0000 (18:28 +0200)]
Fix some odd formatting in gulpfile.coffee

7 years agoFix being unable to scroll the page on some sites
Simon Lydell [Thu, 2 Jun 2016 15:50:06 +0000 (17:50 +0200)]
Fix being unable to scroll the page on some sites

7 years agoRemove repeated word in a comment
Simon Lydell [Thu, 2 Jun 2016 15:21:45 +0000 (17:21 +0200)]
Remove repeated word in a comment

7 years agoDrastically speed up `find_from_top_of_viewport`
Simon Lydell [Thu, 2 Jun 2016 15:15:39 +0000 (17:15 +0200)]
Drastically speed up `find_from_top_of_viewport`

- Don't recurse into children of elements when looking for visible text
  nodes; we'll get to them anyway since we iterate over every element of
  the page.
- Don't bother checking text nodes that we already know are whitespace
  only.

Fixes #747.

7 years agoRemove trailing whitespace in fr locale
Simon Lydell [Wed, 1 Jun 2016 05:59:06 +0000 (07:59 +0200)]
Remove trailing whitespace in fr locale

7 years agoUpdate zh-CN locale (#745)
av2000ii [Wed, 1 Jun 2016 05:14:42 +0000 (13:14 +0800)]
Update zh-CN locale (#745)

Fix some ambiguous/wrong translations.

7 years agoUpdate fr locale (#744)
Mickaël RAYBAUD-ROIG [Wed, 1 Jun 2016 05:13:36 +0000 (07:13 +0200)]
Update fr locale (#744)

Refs. #728

7 years agoPrevent accidental command activation after pressing `/`
Simon Lydell [Mon, 30 May 2016 14:36:15 +0000 (16:36 +0200)]
Prevent accidental command activation after pressing `/`

7 years agoUpdate zh-TW locale (#743)
Salas [Mon, 30 May 2016 14:30:28 +0000 (22:30 +0800)]
Update zh-TW locale (#743)

Refs. #728

7 years agoVimFx v0.16.1 v0.16.1
Simon Lydell [Sun, 29 May 2016 19:09:58 +0000 (21:09 +0200)]
VimFx v0.16.1

7 years agoFix crash in the `zF` command
Simon Lydell [Sun, 29 May 2016 19:08:32 +0000 (21:08 +0200)]
Fix crash in the `zF` command

7 years agoVimFx v0.16.0 v0.16.0
Simon Lydell [Sun, 29 May 2016 18:23:19 +0000 (20:23 +0200)]
VimFx v0.16.0

7 years agoUpdate devDependencies
Simon Lydell [Sun, 29 May 2016 18:13:39 +0000 (20:13 +0200)]
Update devDependencies

7 years agoImprove nonCoveredPoint checks
Simon Lydell [Sun, 29 May 2016 09:29:34 +0000 (11:29 +0200)]
Improve nonCoveredPoint checks

- Skip trying to the right of a covering element if that's further to
  the right than the element's rect.

- If the covering element is a parent to the element we're checking,
  don't try looking to the right of the parent. It is _very_ unlikely
  that we'll find the element we're checking there. Instead, try the
  most likely point to be non-covered: The center of the element. This
  needs to be done because of pseudo-elements of the parent element
  which might cover the link partly, likely at the edges. Fixes #742.

7 years agoInclude possibly covered elements for complementary hints
Simon Lydell [Sun, 29 May 2016 07:39:47 +0000 (09:39 +0200)]
Include possibly covered elements for complementary hints

There might be false positives when checking if an element is covered or
not. This commit includes covered elements when switching to
complementary hints (`<c-enter>` in Hints mode), so that you can target
for example links which are only partly covered.

See #742.

7 years agoImprove the Find next/previous commands
Simon Lydell [Fri, 27 May 2016 17:39:15 +0000 (19:39 +0200)]
Improve the Find next/previous commands

- Finding is asynchronous. This commit makes sure to wait until the
  finding is done before sending notifications (such as "Phrase not
  found"). This makes the notifications more reliable.
- Prevent the find bar from re-opening if there are no matches.
  Fixes #739.

7 years agoFix focus handling
Simon Lydell [Fri, 27 May 2016 07:29:46 +0000 (09:29 +0200)]
Fix focus handling

When blurring a UI element, we handle that blur after a timeout. If
the UI element was blurred due to focusing a frame element, the focus
events for that frame element occurs _before_ handling the UI blur. That
caused the focusType to be set according to the UI blur, and not
according to the frame focus. This meant that if you had the location
bar focused and clicked inside a text input in a web page, VimFx would
enter and then immediately exit "auto insert mode". This commit fixes
this issue by asking the frame script for the focusType if a 'focus' or
'blur' event is caught in the UI and the active element is the current
`<browser>` (instead of treating `<browser>` as focusType 'none').

Also, since commit fee33fa8, 'focusTypeChange' events are only sent when
_changing_ the focusType of a `vim`, _not_ when trying to set the
focusType to the same value as before. While that's good, it caused a
problem when switching tabs. When switching tabs, 'blur' events occur in
the old tab and (re-)'focus' events occur in the new tab, but no
focusType of any `vim` is necessarily changed. However, one tab might be
in "auto insert mode" while the other isn't, so the button would still
need to be updated. Therefore, this commit sends a 'focusTypeChange'
event when switching tabs.

See #738.

7 years agoUpdate es locale (#737)
strel [Tue, 24 May 2016 04:57:19 +0000 (06:57 +0200)]
Update es locale (#737)

Refs. #728

7 years agoUpdate zh-CN locale (#736)
av2000ii [Mon, 23 May 2016 05:02:31 +0000 (13:02 +0800)]
Update zh-CN locale (#736)

Refs. #728

7 years agoUpdate release procedure docs
Simon Lydell [Sun, 22 May 2016 16:32:29 +0000 (18:32 +0200)]
Update release procedure docs

7 years agoVimFx v0.15.1 v0.15.1
Simon Lydell [Sun, 22 May 2016 16:28:55 +0000 (18:28 +0200)]
VimFx v0.15.1

7 years agoUpdate release procedure docs
Simon Lydell [Sun, 22 May 2016 16:28:12 +0000 (18:28 +0200)]
Update release procedure docs

7 years agoUpdate ja locale (#734)
pluser [Sat, 21 May 2016 17:24:04 +0000 (02:24 +0900)]
Update ja locale (#734)

Refs. #728

8 years agoImprove hints on Twitter
Simon Lydell [Fri, 20 May 2016 18:55:16 +0000 (20:55 +0200)]
Improve hints on Twitter

- Removes a useless hint that covered the hint for showing more tweets.
  Thanks to @XrXr for reporting and suggesting a fix. Supersedes and
  closes #732.

- Adds a hint for each tweet, allowing to open it in the
  popup/modal/lightbox thingy.

8 years agoImprove focusType detection
Simon Lydell [Fri, 20 May 2016 15:35:35 +0000 (17:35 +0200)]
Improve focusType detection

Inputs focused and blurred inside the Evernote Web Clipper extension's
popup (which is an `<iframe>` injected into the browser UI) were
previously not detected (making it difficult to type into them without
triggering VimFx commands). That was because we have to check if events
really are UI events or not in order to support non-multi-process
Firefox (which expose web page content events to UI code), and
Evernote's elements seem to be indistinguishable from web page content.

This commit simply removes the check for where the event comes from when
looking for focusType changes. Luckily, it doesn't matter if we happen
to handle web page content events in the UI.

To avoid excessive 'focusTypeChange' events (a single focus or blur
might trigger 'focusTypeChange' twice now: Once in the UI code, and once
in the frame script), this commit also makes sure that setting the
focusType to the same value as before is a no-op.

Fixes #733.

8 years agoRemove unneeded line of code
Simon Lydell [Thu, 19 May 2016 05:14:52 +0000 (07:14 +0200)]
Remove unneeded line of code

8 years agoVimFx v0.15.0 v0.15.0
Simon Lydell [Wed, 18 May 2016 15:56:28 +0000 (17:56 +0200)]
VimFx v0.15.0

8 years agoUpdate devDependencies
Simon Lydell [Wed, 18 May 2016 15:52:59 +0000 (17:52 +0200)]
Update devDependencies

8 years agoUpdate nl locale (#731)
HJTP [Tue, 17 May 2016 15:22:20 +0000 (17:22 +0200)]
Update nl locale (#731)

Refs. #728.

8 years agoUpdate id locale (#730)
Yoppy Halilintar [Sun, 15 May 2016 17:27:11 +0000 (00:27 +0700)]
Update id locale (#730)

Refs. #728

8 years agoUpdate de locale (#729)
just-barcodes [Sun, 15 May 2016 14:51:17 +0000 (15:51 +0100)]
Update de locale (#729)

Refs. #728

8 years agoDon't trigger VimFx commands in some fancy text inputs
Simon Lydell [Sun, 15 May 2016 13:22:42 +0000 (15:22 +0200)]
Don't trigger VimFx commands in some fancy text inputs

Fixes #725.

8 years agoRemove unnecessary newline
Simon Lydell [Sun, 15 May 2016 12:46:59 +0000 (14:46 +0200)]
Remove unnecessary newline

8 years agoAdd tests for and clean up parse-prefs.coffee
Simon Lydell [Sun, 15 May 2016 12:41:23 +0000 (14:41 +0200)]
Add tests for and clean up parse-prefs.coffee

8 years agoSpeed up and refactor Hints mode
Simon Lydell [Sun, 8 May 2016 18:56:54 +0000 (20:56 +0200)]
Speed up and refactor Hints mode

This makes most hints show up on screen up to twice as fast as before.
The rest of the hints show up at the same speed as before. Hints
generation has been optimized for the common case, by looking for
markable elements in two passes (if needed and possible). First, we look
for common and fast-to-find elements (such as links); then we look for
everything else. Addresses #409.

Code has been pulled out of marker.coffee, modes.coffee and
hints.coffee, and put into the new marker-container.coffee. hints.coffee
was then renamed to markable-elements.coffee (because all it does now is
finding markable elements).

The concept of tagging elements as "semantic" has been removed. The idea
was to give "unsemantic" elements worse hints (so they wouldn't trump
links, for example). Now, such elements are usually found in the second
pass instead, which gives about the same effect.

`<c-enter>` in Hints mode no longer replaces all hints with new ones for
_all_ elements on screen. Instead, it replaces the hints with hints for
all _unmarked_ elements on screen. Pressing `<c-enter>` again toggles
back to the original hints.

There is a breaking API change for `vimfx.setHintMatcher(hintMatcher)`.
`hintMatcher` no longer receives and returns an object (of the shape
`{type, semantic}`), but instead simply receives and returns the `type`
of the element.

8 years agoMake it easier to find how to customize hint marker font size
Simon Lydell [Sun, 15 May 2016 10:55:10 +0000 (12:55 +0200)]
Make it easier to find how to customize hint marker font size

See #727.

8 years agoFix a failing test
Simon Lydell [Sat, 14 May 2016 14:35:10 +0000 (16:35 +0200)]
Fix a failing test

8 years agoPin the coffee-script version
Simon Lydell [Sat, 14 May 2016 10:58:19 +0000 (12:58 +0200)]
Pin the coffee-script version

The very latest commits of coffee-script break coffeelint. This pins the
coffee-script dependency to a commit that both compiles VimFx and runs
coffeelint as intended.

8 years agoFix frame scripts being loaded more than once sometimes
Simon Lydell [Fri, 13 May 2016 06:05:03 +0000 (08:05 +0200)]
Fix frame scripts being loaded more than once sometimes

1. Open several tabs.
2. Set Firefox to remember your tabs between sessions.
3. Restart Firefox. All but the current tab will now be in a "pending"
   (unloaded) state.
4. Update/re-install VimFx.
5. Visit one of the pending tabs.

Now, the frame script will be loaded _twice_ in that tab, which for
example causes `f` to produce double-clicks. This is especially
noticeable during development, when you update/re-install VimFx all the
time.

The reason is that Firefox does not seem to load frame scripts in
pending tabs immediately. Instead, the URI to the frame script we asked
to load is remembered and then loaded when you actually visit the
pending tab in question. If you update VimFx before doing so, yet one
frame script URI will be pushed to that stack, causing _two_ instances
of it to be loaded when visiting the tab. Both of those will be from the
new VimFx version; the URIs are the same, and the file at that URI has
now been updated.

This commit attempts to solve this problem by generating a
`bootstrap-frame-$BUILD_TIME.js` file (which simply runs
`bootstrap.coffee`) and loading that as a frame script. This means that
old saved frame script URIs will point to non-existing files and thus
be harmless.

8 years agoFix arithmetic mistakes in `isInsideViewport`
Simon Lydell [Wed, 11 May 2016 15:12:31 +0000 (17:12 +0200)]
Fix arithmetic mistakes in `isInsideViewport`

8 years agoUpdate zh-CN locale (#726)
av2000ii [Tue, 10 May 2016 05:04:07 +0000 (13:04 +0800)]
Update zh-CN locale (#726)

8 years agoVimFx v0.14.3 v0.14.3
Simon Lydell [Sun, 8 May 2016 14:36:01 +0000 (16:36 +0200)]
VimFx v0.14.3

8 years agoFix `scroll.reset_timeout` pref typo
Simon Lydell [Sun, 8 May 2016 14:30:05 +0000 (16:30 +0200)]
Fix `scroll.reset_timeout` pref typo

8 years agoVimFx v0.14.2 v0.14.2
Simon Lydell [Sun, 8 May 2016 12:12:04 +0000 (14:12 +0200)]
VimFx v0.14.2

8 years agoUpdate devDependencies
Simon Lydell [Sun, 8 May 2016 11:44:17 +0000 (13:44 +0200)]
Update devDependencies

8 years agoDon't break the Developer Toolbar when pressing `<escape>`
Simon Lydell [Sun, 8 May 2016 09:48:03 +0000 (11:48 +0200)]
Don't break the Developer Toolbar when pressing `<escape>`

Fixes #723.

8 years agoFix devtools detection in newer Firefox versions
Simon Lydell [Sun, 8 May 2016 09:24:16 +0000 (11:24 +0200)]
Fix devtools detection in newer Firefox versions

8 years agoFix smooth scrolling speed in newer Firefox versions
Simon Lydell [Sun, 8 May 2016 07:34:48 +0000 (09:34 +0200)]
Fix smooth scrolling speed in newer Firefox versions

The following pseudo-code used to work:

    setFirefoxSpringConstant()
    startScrollingSmoothly()
    resetFirefoxSpringConstant()
    // Some time later: Smooth scrolling finishes.

However, in some newer Firefox version that's changed.
`resetFirefoxSpringConstant` now has to be called when the smooth
scrolling is done, it seems. Unfortunately there appears to be no way of
knowing when that's the case. Instead, this commit introduces a timeout
before the spring constant pref is reset. The timeout can be customized
via the `scroll.reset_timeout` pref if needed. Special care was taken so
that, for example, holding `j` to scroll would only reset the pref
_once_ (after the last scroll command) and to the correct value.

8 years agoImprove copying of element text
Simon Lydell [Sun, 8 May 2016 06:31:56 +0000 (08:31 +0200)]
Improve copying of element text

Slack uses markdown-style backtick syntax for code spans. Example:

    one `code` two

This is the rendered HTML for the above:

    <span class="message_body">
      one
      <code class="special_formatting">
        <span class="copyonly">`</span>code<span class="copyonly">`</span>
      </code>
      two
    </span>

Previously, `.textContent` was used to copy element text. Because those
backticks actually are there in the DOM, they get copied too. However,
that's unexpected because they're not visible. The `yv` command is
supposed to be equivalent to `zv<hintchars>y`, but this meant that it
wasn't.

This commit instead creates an actual selection and then invokes
Firefox's `cmd_copy` command (which is exactly what `zv` followed by `y`
does). A difference is that now you can see the created selection flash
for a split second, but I actually like that visual feedback.

This fix also has a positive effect on the `yf` command when copying
`contenteditable` elements. Take this markup:

    <div contenteditable="true">T</div>

Then type `<backspace>one<enter><enter>two` in it. Finally, copy the
element using `yf`.

Before, you'd get this:

```
onetwo
```

Now, you get the expected result:

```
one

two
```

8 years agoImprove Help dialog font spacing
Simon Lydell [Thu, 5 May 2016 22:28:59 +0000 (00:28 +0200)]
Improve Help dialog font spacing

8 years agoIgnore Lock keys such as NumLock and CapsLock
Simon Lydell [Tue, 3 May 2016 08:17:06 +0000 (10:17 +0200)]
Ignore Lock keys such as NumLock and CapsLock

This makes it possible pressing NumLock and CapsLock in the middle of a
multi-key shortcut without aborting it, allowing to type some keys of shortcut
usinng NumLock and CapsLock.

Note that this remove support for using `<capslock>` and `<numlock>` in
shortcuts, but that was never a good idea anyway, since for example `<capslock>`
would _both_ trigger a VimFx command _and_ toggle CapsLock.

8 years agoVimFx v0.14.1 v0.14.1
Simon Lydell [Sat, 30 Apr 2016 08:42:58 +0000 (10:42 +0200)]
VimFx v0.14.1

8 years agoFix Find mode crash
Simon Lydell [Sat, 30 Apr 2016 08:40:55 +0000 (10:40 +0200)]
Fix Find mode crash

8 years agoVimFx v0.14.0 v0.14.0
Simon Lydell [Fri, 29 Apr 2016 17:30:43 +0000 (19:30 +0200)]
VimFx v0.14.0

8 years agoUpdate devDependencies
Simon Lydell [Fri, 29 Apr 2016 17:22:53 +0000 (19:22 +0200)]
Update devDependencies

8 years agoTiny documentation fixes
Simon Lydell [Fri, 29 Apr 2016 06:06:37 +0000 (08:06 +0200)]
Tiny documentation fixes

8 years agoImprove Find mode search start position
Simon Lydell [Sun, 3 Apr 2016 14:01:14 +0000 (16:01 +0200)]
Improve Find mode search start position

By default, Firefox starts searching after the end of the first selection range,
or from the top of the page if there are no selection ranges. This means that if
you search for "vim", a match for "vim" further up or down the page might be
selected, even though the word "vim" might already be onscreen, because of the
current selection (or lack thereof).

Vim starts searching in a similar way: After the cursor. The difference is that
in Vim, the cursor is _always_ onscreen. When you scroll, the cursor is "pushed
along" by the edges of the screen. This way, it is always very easy to tell
where you are going to start your search from. In Firefox, though, using the `/`
command can be quite disorienting.

Another Vim example: Let's say I searched for "vim" again (pressing `/vim` in
Vim). I then go through a few matches using `n`. Then I come to a block of text
that mentions "vim" _lots_ of times, and I realize that I'm not interested in
that block at all. Then it is easier to scroll (or "jump") past that block
rather than spamming `n` over and over (or trying to guess an appropriate
count). When doing the same in Firefox, though, after having scrolled past the
mentioned block of text, the next `n` keypress will scroll up right back to the
last match and continue the search there. This is pretty annoying to me.

While there's the Caret mode (which few people use) and the possibility to
select text in Firefox, there's usually no concept of a caret, and the caret
does not follow the scroll; it stays where it is, possibly offscreen. So where
should we start searching from, really?

This commit implements the following logic:

If there's a visible selection on screen, start searching after that point. If
not, start searching from the top of the current viewport. This works much more
intuitively. Note: Elements with `position: fixed;` are excluded when
determining "the top of the viewport".

Inspired by vimium/issues#1471.

8 years agoAdd missing `require` in commands.coffee
Simon Lydell [Tue, 26 Apr 2016 11:02:28 +0000 (13:02 +0200)]
Add missing `require` in commands.coffee

8 years agoAdd missing comments for `utils.bisect`
Simon Lydell [Tue, 26 Apr 2016 07:12:42 +0000 (09:12 +0200)]
Add missing comments for `utils.bisect`

8 years agoImprove `zv` caret position
Simon Lydell [Wed, 20 Apr 2016 13:32:27 +0000 (15:32 +0200)]
Improve `zv` caret position

If the start of the element is outside the viewport, put the caret at the first
_visible_ non-whitespace character instead.

8 years agoAdd Caret mode
Simon Lydell [Tue, 19 Apr 2016 18:27:08 +0000 (19:27 +0100)]
Add Caret mode

Fixes #480.

8 years agoImprove "open link in new tab" interoperability
Simon Lydell [Sun, 24 Apr 2016 10:01:52 +0000 (12:01 +0200)]
Improve "open link in new tab" interoperability

When opening a link in a new tab, such as when using the `F` or `gf` commands,
we now try to closely mimic what Firefox does when you click links using the
mouse, instead of directly using `gBrowser.loadOneTab(url, options)`.

This provides interoperability with the BackTrack Tab History add-on, which
fixes #720, and allows to remove Tree Style Tab-specific code.

8 years agoMove viewport calculations from hints.coffee to utils.coffee
Simon Lydell [Tue, 19 Apr 2016 18:16:40 +0000 (20:16 +0200)]
Move viewport calculations from hints.coffee to utils.coffee

It's cleaner and more reusable.

This also fixes a slight bug for markers in frames. Previously, if the frame had
padding and/or borders its calculated viewport was a tiny bit too large. Now,
padding and borders are taken into account.

8 years agoChange `<c-a>` to `<c-enter>` in Hints mode
Simon Lydell [Mon, 18 Apr 2016 19:22:38 +0000 (21:22 +0200)]
Change `<c-a>` to `<c-enter>` in Hints mode

Using `<c-a>` for marking _all_ elements was nice, because `<c-a>` usually means
"select all". However, it conflicts with the "hold ctrl when typing the last
hint character to toggle if the link opens in a new tab or not" feature. If the
last character was an "a" that wouldn't happen; instead, the `<c-a>` command
would be invoked. This commit changes to `<c-enter>` which should be conflict
free.

8 years agoAdd the `<c-a>` Hints mode command to mark everything
Simon Lydell [Sun, 17 Apr 2016 12:41:08 +0000 (14:41 +0200)]
Add the `<c-a>` Hints mode command to mark everything

8 years agoFix argument order of an `isInsideViewport` call
Simon Lydell [Thu, 14 Apr 2016 16:56:49 +0000 (18:56 +0200)]
Fix argument order of an `isInsideViewport` call

8 years agoRemove horizontal alignment in multiline function calls
Simon Lydell [Wed, 13 Apr 2016 15:10:56 +0000 (17:10 +0200)]
Remove horizontal alignment in multiline function calls

This is to reduce unnecessary diffs and to be able to use search-and-replace to
rename things without having to worry about fixing alignment.

8 years agoFix `__dirname` in config files on Windows
Simon Lydell [Mon, 11 Apr 2016 06:59:10 +0000 (08:59 +0200)]
Fix `__dirname` in config files on Windows

`OS.Path.dirname` does not seem to support `file://` URIs on Windows.
`OS.Path.dirname('file:///C:/Users/foo/.vimfx/config.js')` returns `'file:'`.

This commit calculates the dirname in a different way to work around the above
problem.

Thanks to @azuwis for finding out and suggesting a fix.

Supersedes and closes #719.

8 years agoRemove unnecessary full-page hint marker on Hackernews
Simon Lydell [Sat, 9 Apr 2016 13:50:09 +0000 (15:50 +0200)]
Remove unnecessary full-page hint marker on Hackernews

8 years agoVimFx v0.13.2 v0.13.2
Simon Lydell [Fri, 8 Apr 2016 17:11:04 +0000 (19:11 +0200)]
VimFx v0.13.2

8 years agoFix illogical code order in scrolling commands
Simon Lydell [Wed, 6 Apr 2016 15:53:42 +0000 (17:53 +0200)]
Fix illogical code order in scrolling commands

Logically, one should set the `last_position_mark` mark _before_ jumping
somwhere. However, for the `G`, `g`, `$` and `0` commands, the message to set it
was sent _after_ the message to scroll was sent!

Somehow it has still worked as intended for me.

This commit reverses the order.

This might fix #717.

8 years agoAllow `<space>` to toggle play/pause in more video players
Simon Lydell [Wed, 6 Apr 2016 06:47:51 +0000 (08:47 +0200)]
Allow `<space>` to toggle play/pause in more video players

8 years agoFix wrong viewport size for hints in quirks mode
Simon Lydell [Sun, 3 Apr 2016 16:18:17 +0000 (18:18 +0200)]
Fix wrong viewport size for hints in quirks mode

8 years agoUpdate devDependencies
Simon Lydell [Sun, 3 Apr 2016 09:43:11 +0000 (11:43 +0200)]
Update devDependencies

8 years agoFix lint error
Simon Lydell [Sun, 3 Apr 2016 09:38:08 +0000 (11:38 +0200)]
Fix lint error

8 years agoRemove unnecessary `return` in commands.coffee
Simon Lydell [Sun, 3 Apr 2016 09:37:40 +0000 (11:37 +0200)]
Remove unnecessary `return` in commands.coffee

8 years agoVimFx v0.13.1 v0.13.1
Simon Lydell [Fri, 1 Apr 2016 16:28:12 +0000 (18:28 +0200)]
VimFx v0.13.1

8 years agoImprove automatic mode switching on page load
Simon Lydell [Fri, 1 Apr 2016 14:30:08 +0000 (16:30 +0200)]
Improve automatic mode switching on page load

Previously, Normal mode was _always_ entered on location change (page load)
(unless the page is blacklisted; then Ignore mode is entered instead). There
were to reasons for this: Handling the blacklist, and auto-exiting hints mode
(because hints left over from another page does not make sense in a new page).
However, this caused a few problems:

- If you used the `zF` command while a page was loading, the markers would
  disappear when the page fired the "location change" event.
- There was an ugly special case for Find mode, making sure not to enter Normal
  mode if currently in Find mode (see commit fc7e61e7c).
- Sometimes, you can enter Hints mode on a newly loaded page just before the
  page fires the "location change" event, making hints annoyingly disappear.

This commit changes two things:

- Hints mode is automatically exited (by returning to Normal mode) on the
  'pagehide' event instead.
- The current mode is only changed on location change _if needed._ That is, to
  auto-exit Ignore mode after navigating away from a blacklisted page, or
  auto-enter Ignore mode on blacklisted pages.

8 years agoClear artificial hover on blur
Simon Lydell [Fri, 1 Apr 2016 05:44:09 +0000 (07:44 +0200)]
Clear artificial hover on blur

Previously, if you focused an element using an `f` command and then pressed
`<tab>` to focus the next element, or if the element was automatically blurred,
the element would still look hovered until you pressed `<escape>`. This is
because many `f` commands lock the `:hover` pseudo-class on their target
element. This commit unlocks that pseudo-class if that element blurs, preventing
elements from getting "stuck". It is only done if the element itself is blurred,
not if anything else is. That's to make sure that dropdown menus opened using
`zf` don't close unexpectedly.

8 years agoFix blacklisting of some XUL pages
Simon Lydell [Mon, 28 Mar 2016 14:39:06 +0000 (16:39 +0200)]
Fix blacklisting of some XUL pages

Fixes #716.

Imprint / Impressum