diff options
| author | Stephen Blott | 2015-01-26 06:31:34 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-01-26 06:31:34 +0000 |
| commit | ef9a8473d7d6b932de21642684f27e7696aac01b (patch) | |
| tree | 508bc59da6e36ece25dcac5e7c5a732467ca9b65 | |
| parent | 1a83f98dcbea073ddf0221fe57fcad1d1c198129 (diff) | |
| download | vimium-ef9a8473d7d6b932de21642684f27e7696aac01b.tar.bz2 | |
Visual/edit modes: minor changes.
| -rw-r--r-- | background_scripts/commands.coffee | 1 | ||||
| -rw-r--r-- | content_scripts/mode_visual_edit.coffee | 15 |
2 files changed, 8 insertions, 8 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index 80f18409..b8623fc8 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -201,6 +201,7 @@ defaultKeyMappings = "v": "enterVisualMode" "V": "enterVisualLineMode" "e": "enterEditMode" + "gv": "enterEditMode" "H": "goBack" "L": "goForward" diff --git a/content_scripts/mode_visual_edit.coffee b/content_scripts/mode_visual_edit.coffee index 8f7f3ded..3659c7ba 100644 --- a/content_scripts/mode_visual_edit.coffee +++ b/content_scripts/mode_visual_edit.coffee @@ -239,15 +239,14 @@ class Movement extends MaintainCount # Try to scroll the focus into view. scrollIntoView: -> @protectClipboard => - element = document.activeElement - if element and DomUtils.isEditable element - if element.clientHeight < element.scrollHeight - if element.isContentEditable - # How do we do this? + if @element and DomUtils.isEditable @element + if @element.clientHeight < @element.scrollHeight + if @element.isContentEditable + # How do we do this? This case matters for gmail and Google's inbox. else - position = if @getDirection() == backward then element.selectionStart else element.selectionEnd - coords = DomUtils.getCaretCoordinates element, position - Scroller.scrollToPosition element, coords.top, coords.left + position = if @getDirection() == backward then @element.selectionStart else @element.selectionEnd + coords = DomUtils.getCaretCoordinates @element, position + Scroller.scrollToPosition @element, coords.top, coords.left else elementWithFocus = @getElementWithFocus @selection Scroller.scrollIntoView elementWithFocus if elementWithFocus |
