aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--background_scripts/commands.coffee1
-rw-r--r--content_scripts/mode_visual_edit.coffee15
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