     @countPrefix = ""
 
   pasteClipboard: (direction) ->
-    @protectClipboard =>
-      @paste (text) =>
-        if text
-          lineOriented = text == Movement.lastLineSelection
-          if lineOriented
-            @runMovement "#{direction} lineboundary"
-            text = if direction == forward then "\n" + text else text + "\n"
-          DomUtils.simulateTextEntry @element, text
-          @runMovement "backward line" if lineOriented
+    @protectClipboard (text) =>
+      if text
+        # We use the heuristic that the paste is line oriented if the last character is a newline.  This is
+        # consistent with the way runMovement selects text in visual mode for "forward lineboundary".
+        lineOriented = /\n$/.test text
+        if lineOriented
+          @runMovement "#{direction} lineboundary"
+          @runMovement "#{direction} character" if direction == forward
+        DomUtils.simulateTextEntry @element, text
+        # Slow!  Expensive!  Better way?
+        @runMovement "backward character" for [0...text.length] if lineOriented
 
   openLine: (direction) ->
     @runMovement "#{direction} lineboundary"


# To do:
# - handle edit-mode losing the focus
# - line-visual mode
# - definition of a line.
# - better implementation of `o`
# - caret mode
# - yy

      underEditMode: false
    super extend defaults, options

    extend @commands, "y": @yank

    if @options.underEditMode
      extend @commands,
        "d": @yank
        "c": -> @yank(); enterInsertMode()

class VisualModeForEdit extends VisualMode
  constructor: (options = {}) ->
