]> git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/vim-mode/lib/insert-mode.coffee
Update atoms
[rbdr/dotfiles] / atom / packages / vim-mode / lib / insert-mode.coffee
1 copyCharacterFromAbove = (editor, vimState) ->
2 editor.transact ->
3 for cursor in editor.getCursors()
4 {row, column} = cursor.getScreenPosition()
5 continue if row is 0
6 range = [[row-1, column], [row-1, column+1]]
7 cursor.selection.insertText(editor.getTextInBufferRange(editor.bufferRangeForScreenRange(range)))
8
9 copyCharacterFromBelow = (editor, vimState) ->
10 editor.transact ->
11 for cursor in editor.getCursors()
12 {row, column} = cursor.getScreenPosition()
13 range = [[row+1, column], [row+1, column+1]]
14 cursor.selection.insertText(editor.getTextInBufferRange(editor.bufferRangeForScreenRange(range)))
15
16 module.exports = {
17 copyCharacterFromAbove,
18 copyCharacterFromBelow
19 }