X-Git-Url: https://git.r.bdr.sh/rbdr/dotfiles/blobdiff_plain/24c7594d62d8d7fbbcdb64b11ce4adc5d8e6991a..5d7da6fb3524f3361002588f8a23154136b7cd0d:/atom/packages/vim-mode-visual-block/lib/main.coffee?ds=sidebyside 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()