aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-01-28 12:40:38 +0000
committerStephen Blott2016-01-28 12:40:38 +0000
commitdae75d47a6662d6a65391215c2998b705942bf10 (patch)
treefbd047d8cd1491b50a489a783cacd241a9d1e82f
parent34e2fe6fd53d32b0f4b2f6463cea25ae4ad24927 (diff)
parentf83ef9ff332e37b8e12d8ca608b1e193003669e1 (diff)
downloadvimium-dae75d47a6662d6a65391215c2998b705942bf10.tar.bz2
Merge pull request #1942 from smblott-github/enable-edit-mode
Enable edit mode.
-rw-r--r--README.md1
-rw-r--r--background_scripts/commands.coffee6
-rw-r--r--content_scripts/mode_visual_edit.coffee4
3 files changed, 8 insertions, 3 deletions
diff --git a/README.md b/README.md
index fe3475be..3e409f92 100644
--- a/README.md
+++ b/README.md
@@ -155,6 +155,7 @@ Release Notes
-------------
Next version (not yet released)
+- Edit mode for text inputs (including GMail): `gv` (beta feature).
- Bug fixes:
- Fix endless scrolling (#1911).
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index c8121a96..5dfd5259 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -98,7 +98,7 @@ Commands =
"enterInsertMode",
"enterVisualMode",
"enterVisualLineMode",
- # "enterEditMode",
+ "enterEditMode",
"focusInput",
"LinkHints.activateMode",
"LinkHints.activateModeToOpenInNewTab",
@@ -187,7 +187,7 @@ defaultKeyMappings =
"i": "enterInsertMode"
"v": "enterVisualMode"
"V": "enterVisualLineMode"
- # "gv": "enterEditMode"
+ "gv": "enterEditMode"
"H": "goBack"
"L": "goForward"
@@ -279,7 +279,7 @@ commandDescriptions =
enterInsertMode: ["Enter insert mode", { noRepeat: true }]
enterVisualMode: ["Enter visual mode", { noRepeat: true }]
enterVisualLineMode: ["Enter visual line mode", { noRepeat: true }]
- # enterEditMode: ["Enter vim-like edit mode (not yet implemented)", { noRepeat: true }]
+ enterEditMode: ["Enter vim-like edit mode (beta feature)", { noRepeat: true }]
focusInput: ["Focus the first text box on the page. Cycle between them using tab",
{ passCountToFunction: true }]
diff --git a/content_scripts/mode_visual_edit.coffee b/content_scripts/mode_visual_edit.coffee
index 9e597cca..8bcde6cb 100644
--- a/content_scripts/mode_visual_edit.coffee
+++ b/content_scripts/mode_visual_edit.coffee
@@ -554,6 +554,10 @@ class VisualMode extends Movement
if document.activeElement and DomUtils.isEditable document.activeElement
document.activeElement.blur() unless event?.type == "click"
+ if @options.parentMode
+ # E.g. when exiting visual mode under edit mode, we no longer want the selection.
+ @collapseSelectionToFocus()
+
super event, target
if @yankedText?
unless @options.noCopyToClipboard