Skip to content

Commit

Permalink
Revert "Exit insert mode upon tab switch. Closes #314."
Browse files Browse the repository at this point in the history
This reverts commit 9e14b51.

Conflicts:

	vimiumFrontend.js
  • Loading branch information
int3 committed Feb 27, 2012
1 parent 18d5b9f commit bd48e36
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions vimiumFrontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function initializeWhenEnabled() {
document.addEventListener("keypress", onKeypress, true);
document.addEventListener("keyup", onKeyup, true);
document.addEventListener("focus", onFocusCapturePhase, true);
window.addEventListener("blur", onBlurCapturePhase, true);
document.addEventListener("blur", onBlurCapturePhase, true);
document.addEventListener("DOMActivate", onDOMActivate, true);
enterInsertModeIfElementIsFocused();
}
Expand Down Expand Up @@ -563,12 +563,7 @@ function onFocusCapturePhase(event) {
}

function onBlurCapturePhase(event) {
if (event.target == window)
// At this point, we will have exited insert mode already, but the browser remembers which element last
// had focus, and fires a focus event on it when the window regains focus. We blur this element to prevent
// implicit insert mode from reactivating when we switch back to this tab.
document.activeElement.blur();
else if (isFocusable(event.target))
if (isFocusable(event.target))
exitInsertMode(event.target);
}

Expand Down

0 comments on commit bd48e36

Please sign in to comment.