| Age | Commit message (Collapse) | Author |
|
This previous file name was chosen when we (I) had the intention of
implementing edit mode too.
That initiative has been abandoned, so the file name is inappropriate.
Renaming now in preparation for a significant refactoring of visual
mode.
|
|
The styles guide says not to use standalone `@`. So this changes the
occurrences I could find (with sed) to `this`. Occurrences within files
with major outstanding PRs are omitted.
|
|
I am now of the opinion that we should not do this within Vimium, as:
- better solutions exist externally, and
- it's better to not have to maintain this.
|
|
This applies only to the case where visual mode is run under edit mode.
Previously, we were leaving the selection in place ... which is weird
and not vim-like.
|
|
|
|
|
|
This only affects the transition from visual mode back to edit mode.
Previously, we were incorrectly leaving the selection in place.
(The comment above was correct, but the implementation wasn't.)
|
|
|
|
This code belongs together, so we put it together.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fix word movement for non-English characters.
|
|
Since we don't use this huge regexp on most pages, lets just compile it
when we need it.
|
|
|
|
Fixes #1592.
|
|
Conflicts:
content_scripts/vimium_frontend.coffee
|
|
|
|
Return to the original viewport (when no find matches)
|
|
Previously, we removed the selection on exiting visual mode. This
collapses the selection instead.
My own experience with visual mode suggests that this is better. In
particular, if we remove the selection, then when the user re-enters
visual mode, they're dropped into caret mode. It is unlikely that the
default caret position selected by caret mode is better than the last
text selected by the user in either caret mode or visual mode.
|
|
|
|
|
|
The intention here is that, under visual mode, a find query with no
matches leaves us at some aribtrary place in the page. Whereas the user
was probably looking at the text they're interested in in the viewport
to begin with. This PR returns to the original viewport in such cases.
(In this commit, return-to-viewport is enabled for *all* finds, not just
under visual mode. I want to try it out like this to see what it feels
like. This is probably not the right UX. It is not what Chrome does.)
|
|
|
|
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.
|
|
- convert getCaretCoordinates from JS to CS
- handle x axis in scrollIntoView
- better comments throughout.
|
|
which was broken.
|
|
There's considerable discussion in #1441 as to what we should do with
the selection on leaving visual mode. Good arguments have been made as
to why we should keep the selection. However, at this point,
keep-it-simple seems like the best strategy, and wholly removing the
selection (probably) provides fewer ways for the user to shoot
themselves in the foot.
|
|
This effectively reverts 95e086563b918364d3038f6489cc97c73fcb7180
(Escape-Escape clears selection) pending discussion of the right UX
around exitng visual mode.
|
|
This reverts commit c1681fea2f2629c6bee1e27c5dfc704d77553d96.
|
|
|
|
When caret mode guesses a selection score text nodes by their visible
area and the number of non-whitespace characters they contain. Choose
the first non-whitespace character in the highest-scoring node.
The intention is to avoid making a poor choice for the initial caret
position.
|
|
|
|
|
|
|
|
|
|
- Collapse to focus when entering caret mode from visual mode.
|
|
- When the user exits visual mode via escape, we reinstall the original
selection (from launch).
|
|
|
|
|
|
|
|
|
|
When visual mode launches and there *is* a selection but it's outside of
the viewport, instead of scrolling it into view, ignore it, and start
with a visible caret.
|
|
- And drop "J".
|
|
|
|
|
|
|