aboutsummaryrefslogtreecommitdiff
path: root/atom/packages/vim-mode-visual-block/lib
diff options
context:
space:
mode:
Diffstat (limited to 'atom/packages/vim-mode-visual-block/lib')
-rw-r--r--atom/packages/vim-mode-visual-block/lib/main.coffee28
1 files changed, 8 insertions, 20 deletions
diff --git a/atom/packages/vim-mode-visual-block/lib/main.coffee b/atom/packages/vim-mode-visual-block/lib/main.coffee
index 61cfe76..dc5a5c2 100644
--- a/atom/packages/vim-mode-visual-block/lib/main.coffee
+++ b/atom/packages/vim-mode-visual-block/lib/main.coffee
@@ -14,15 +14,14 @@ module.exports =
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()
@@ -63,21 +62,20 @@ module.exports =
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)
@@ -125,22 +123,12 @@ module.exports =
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()