 {IS_MOBILE} = require('./feature')
 misc        = require('smc-util/misc')
 {dmp}       = require('smc-util/sync/editor/generic/util')
-buttonbar   = require('./editors/editor-button-bar')
 markdown    = require('./markdown')
 theme       = require('smc-util/theme')
 {QueryParams} = require('./misc/query-params')

                    return src.slice(0,i) + src.slice(i+left.length,j) + src.slice(j+right.length)

        selections = cm.listSelections()
        #selections.reverse()
        for selection in selections
            mode = canonical_mode(cm.getModeAt(selection.head).name)

    #CodeMirror.defineExtension 'setLine', (n, value) ->
    #    @replaceRange()

cm_start_end = (selection) ->
    {head, anchor} = selection
    start = head
