activate: (state) ->
@disposables = new CompositeDisposable
blockwiseCommands = {}
- # [TODO] remove 'h', 'l' after some period.
- commands = 'jkhloDCIA'.split('')
+ commands = 'jkoDCIA'.split('')
commands.push 'escape', 'ctrl-v'
for command in commands
do (command) =>
name = "#{@prefix}:#{command}"
blockwiseCommands[name] = (event) => @blockOperation(event, command)
- blockwiseCommands["#{@prefix}:toggle-debug"] = => @toggleDebug()
+ # blockwiseCommands["#{@prefix}:toggle-debug"] = => @toggleDebug()
@disposables.add atom.commands.add('atom-text-editor', blockwiseCommands)
@reset()
currentRow = editor.getLastCursor()?.getBufferRow()
@startRow ?= currentRow
- # @debug "@startRow = #{@startRow}"
switch command
when 'o'
@startRow = currentRow
when 'D', 'C'
- vimState.activateCommandMode()
+ vimState.activateNormalMode()
event.abortKeyBinding()
when 'escape', 'ctrl-v'
- vimState.activateCommandMode()
+ vimState.activateNormalMode()
editor.clearSelections()
when 'j', 'k'
- cursorPositions = editor.getCursorsOrderedByBufferPosition()
- cursorTop = _.first cursorPositions
- cursorBottom = _.last cursorPositions
+ cursors = editor.getCursorsOrderedByBufferPosition()
+ cursorTop = _.first cursors
+ cursorBottom = _.last cursors
if (command is 'j' and cursorTop.getBufferRow() >= @startRow) or
(command is 'k' and cursorBottom.getBufferRow() <= @startRow)
cursor.setBufferPosition(pointTarget)
adjustCursor(selection) for selection in editor.getSelections()
- vimState.activateCommandMode()
+ vimState.activateNormalMode()
vimState.activateInsertMode()
if command is 'A' and cursorsAdjusted.length
cursor.moveRight() for cursor in cursorsAdjusted
- else
- event.abortKeyBinding()
- content = """
- *#{@prefix}*
- * From version 0.2.5, `#{@prefix}` provide default keymap.
- * And `h`, `l` command become obsolete.
- * Remove all explicit keymap from `keymap.cson`.
- """
- atom.notifications.addWarning content, dismissable: true
-
unless @isVisualBlockMode vimState
@reset()