1 {CompositeDisposable} = require 'atom'
3 Base = require './base'
5 module.exports = class Surround extends Base
6 constructor: (config) ->
7 @command = config.surroundCommand
8 @context = "atom-text-editor.vim-mode.visual-mode"
11 getName: (key) -> "surround-#{key}"
13 getRunner: (left, right) -> ->
14 editor = atom.workspace.getActiveTextEditor()
16 editor.selections.forEach (selection) ->
17 text = selection.getText()
18 selection.insertText "#{left}#{text}#{right}"