]> git.r.bdr.sh - rbdr/dotfiles/blame - atom/packages/vim-surround/lib/command/surround.coffee
Update vim plugins
[rbdr/dotfiles] / atom / packages / vim-surround / lib / command / surround.coffee
CommitLineData
24c7594d
BB
1{CompositeDisposable} = require 'atom'
2
3Base = require './base'
4
5module.exports = class Surround extends Base
6 constructor: (config) ->
7 @command = config.surroundCommand
8 @context = "atom-text-editor.vim-mode.visual-mode"
9 super config
10
11 getName: (key) -> "surround-#{key}"
12
13 getRunner: (left, right) -> ->
14 editor = atom.workspace.getActiveTextEditor()
15 editor.transact ->
16 editor.selections.forEach (selection) ->
17 text = selection.getText()
18 selection.insertText "#{left}#{text}#{right}"