-{CompositeDisposable} = require 'atom'
+{CompositeDisposable, Range} = require 'atom'
 
 module.exports =
   subscriptions: null


  select: ->
    console.log 'Executing command list-edit-select'

  cut: ->
    console.log 'Executing command list-edit-cut'


  delete: ->
    console.log 'Executing command list-edit-delete'

  getListRange: (textBuffer, pos) ->
    bufferText = textBuffer.getText()
    ix =  textBuffer.characterIndexForPosition(pos)

    listStartIx = null
    listEndIx = null
    console.log 'index is ' + ix + ', char is ' + bufferText[ix]
    for i in [ix-1...0]
      if bufferText[i] == '['
        listStartIx = i+1
        break
    for i in [ix...bufferText.length-1]
      if bufferText[i] == ']'
        listEndIx = i
        break

    console.log 'list starts at ' + listStartIx
    if listStartIx? and listEndIx?
      listStartPos = textBuffer.positionForCharacterIndex listStartIx
      listEndPos   = textBuffer.positionForCharacterIndex listEndIx
      new Range(listStartPos, listEndPos)
