         placeholder = tabStops.processText(placeholder, tabstopOptions)
 
       if placeholder then "${#{group}:#{placeholder}}" else "$#{group}"
-      
+
     escape: (ch) ->
       if ch == '$' then '\\$' else ch
 

    # Before inserting snippet we have to reset all available selections
    # to insert snippent right in required place. Otherwise snippet
    # will be inserted for each selection in editor
    
    # Right after that we should save first available selection as buffer range
    caret = buf.positionForCharacterIndex(start)
    @editor.setSelectedBufferRange(new Range(caret, caret))

      @_setSelectedBufferRanges(@_selection.saved)

  _setSelectedBufferRanges: (sels) ->
    filteredSels = sels.filter (s) -> !!s
    if filteredSels.length
      @editor.setSelectedBufferRanges(filteredSels)

  _saveSelection: (delta) ->
    @_selection.saved[@_selection.index] = @editor.getSelectedBufferRange()
