diff options
Diffstat (limited to 'content_scripts/mode_visual_edit.coffee')
| -rw-r--r-- | content_scripts/mode_visual_edit.coffee | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/content_scripts/mode_visual_edit.coffee b/content_scripts/mode_visual_edit.coffee index 8f4459ee..c62fae87 100644 --- a/content_scripts/mode_visual_edit.coffee +++ b/content_scripts/mode_visual_edit.coffee @@ -383,21 +383,24 @@ class Movement extends CountPrefix exit: (event, target) -> unless @options.parentMode or @options.oneMovementOnly - # If we're exiting on escape and there is a range selection, then we leave it in place. However, an - # immediately-following Escape clears the selection. See #1441. - if @selection.type == "Range" and event?.type == "keydown" and KeyboardUtils.isEscape event - handlerStack.push - _name: "visual/range/escape" - click: -> handlerStack.remove(); @continueBubbling - focus: -> handlerStack.remove(); @continueBubbling - keydown: (event) => - handlerStack.remove() - if @selection.type == "Range" and event.type == "keydown" and KeyboardUtils.isEscape event - @collapseSelectionToFocus() - DomUtils.suppressKeyupAfterEscape handlerStack - @suppressEvent - else - @continueBubbling + @selection.removeAllRanges() if event?.type == "keydown" and KeyboardUtils.isEscape event + + # Disabled, pending discussion of fine-tuning the UX. Simpler alternative is implemented above. + # # If we're exiting on escape and there is a range selection, then we leave it in place. However, an + # # immediately-following Escape clears the selection. See #1441. + # if @selection.type == "Range" and event?.type == "keydown" and KeyboardUtils.isEscape event + # handlerStack.push + # _name: "visual/range/escape" + # click: -> handlerStack.remove(); @continueBubbling + # focus: -> handlerStack.remove(); @continueBubbling + # keydown: (event) => + # handlerStack.remove() + # if @selection.type == "Range" and event.type == "keydown" and KeyboardUtils.isEscape event + # @collapseSelectionToFocus() + # DomUtils.suppressKeyupAfterEscape handlerStack + # @suppressEvent + # else + # @continueBubbling super event, target |
