 class SuppressPrintable extends Mode
   constructor: (options = {}) ->
     handler = (event) =>
-      if KeyboardUtils.isPrintable event
-        if event.type == "keydown"
-          # Completely suppress Backspace and Delete, they change the selection.
-          if event.keyCode in [ 8, 46 ]
-            @suppressEvent
-          else
-            DomUtils.suppressPropagation event
-            @stopBubblingAndFalse
-        else
-          @suppressEvent
-      else
-        @stopBubblingAndTrue
+      return @stopBubblingAndTrue if not KeyboardUtils.isPrintable event
+      return @suppressEvent if event.type != "keydown"
+      # Completely suppress Backspace and Delete, they change the selection.
+      @suppressEvent if event.keyCode in [ 8, 46 ]
+      # Suppress propagation (but not preventDefault) for keydown, printable events.
+      DomUtils.suppressPropagation event
+      @stopBubblingAndFalse
 
     super extend options,
       keydown: handler

      J: (count) ->
        for [0...count]
          @runMovement forward, "lineboundary"
          @enterVisualModeForMovement 1, immediateMovement: "w", deleteFromDocument: true
          DomUtils.simulateTextEntry @element, " "

      r: (count) ->
        handlerStack.push
          _name: "repeat-character"
          keydown: (event) =>
            handlerStack.remove()
            if KeyboardUtils.isPrintable event
              keyChar = KeyboardUtils.getKeyChar(event).toLowerCase()
              @enterVisualModeForMovement count, immediateMovement: "l", deleteFromDocument: true
              DomUtils.simulateTextEntry @element, [0...count].map(-> keyChar).join ""
            @suppressEvent


    @enterVisualModeForMovement count,
      immediateMovement: if immediate then "l" else null
      deleteFromDocument: true
      noCopyToClipboard: true
      onYank: (text) =>
        chars =
          for char in text.split ""
