       disposable = switchToLinewise(selection)
     fn(selection)
     disposable?.dispose()
+
+class MoveSelectedTextUp extends MoveSelectedText
+  direction: 'up'
+
+  initState: ->
+    stateByEditor.set(@editor, new State())
+
+  getState: ->
+    stateByEditor.get(@editor)
+
+  hasState: ->
+    stateByEditor.has(@editor)
+
+  removeState: ->
+    stateByEditor.delete(@editor)
+
+  initialize: ->
+    @initState() unless @hasState()
+    unless disposableByEditor.has(@editor)
+      disposable = @vimState.modeManager.onDidDeactivateMode ({mode}) =>
+        @removeState() if mode is 'visual'
+
+      disposableByEditor.set @editor, @editor.onDidDestroy =>
+        disposable.dispose()
+        disposableByEditor.delete(@editor)
+        @removeState()
 
   getInitialOverwrittenBySelection: ->
     overwrittenBySelection = new Map

  @commandPrefix: 'vim-mode-plus-user'
  flashTarget: false

  initState: ->
    stateByEditor.set(@editor, new State())

  getState: ->
    stateByEditor.get(@editor)

  hasState: ->
    stateByEditor.has(@editor)

  removeState: ->
    stateByEditor.delete(@editor)

  initialize: ->
    @initState() unless @hasState()
    unless disposableByEditor.has(@editor)
      disposable = @vimState.modeManager.onDidDeactivateMode ({mode}) =>
        @removeState() if mode is 'visual'

      disposableByEditor.set @editor, @editor.onDidDestroy =>
        disposable.dispose()
        disposableByEditor.delete(@editor)
        @removeState()

  isOverwrite: ->
    atom.config.get('vim-mode-plus-move-selected-text.overwrite')


        overwritten = @getOverwrittenForSelection(selection, overwritten) if @isOverwrite()
        text.unshift(overwritten)
        text

  # Return 0 when no longer movable
  getCount: =>
