       @textarea.removeClass('focus')
       Mercury.trigger('region:blurred', {region: @})
 
-    @textarea.mouseup =>
-      return if @previewing
-      @pushHistory()
-      Mercury.trigger('region:update', {region: @})
-
     @textarea.keydown (event) =>
       return if @previewing
       Mercury.changes = true
       @resize()
       switch event.keyCode
+
+        when 13 # enter or return
+          selection = @selection()
+          text = @textarea.val()
+          start = text.lastIndexOf('\n', selection.start)
+          start = text.lastIndexOf('\n', selection.start - 1) if text[start] == '\n'
+          if text[start + 1] == '-'
+            selection.replace('\n- ', false, true)
+            event.preventDefault()
 
         when 90 # undo / redo
           return unless event.metaKey

# todo:
# make dropping images work
# make primary tools work -- like inserting media, links, tables
# make dropping snippets work
# toolbars should toggle better based on what region your in.. for instance, if I'm in an editable region, I should see
# only that toolbar, and when I focus a markupable region, I should only see that toolbar -- and figure out how that
# impacts the snippet regions and it's lack of a static toolbar (do we disable the visible toolbar, or hide it and shift
# the iframe up?)
# how to handle context for buttons?  if the cursor is within a bold area (**bo|ld**), or selecting it -- it would be
# nice if we could activate the bold button for instance.



  wrap: (left, right) ->
    @getDetails()
    @deselectNewLines()
    @replace(left + @text + right, @text != '')
    @select(@start + left.length, @start + left.length) if @text == ''


  wrapLine: (left, right, selectAfter = true, reselect = false) ->
    @getDetails()
    savedSelection = @serialize()
    text = @element.val()
    start = text.lastIndexOf('\n', @start)
    end = text.indexOf('\n', @end)
    end = text.length if end < start
    start = text.lastIndexOf('\n', @start - 1) if text[start] == '\n'
    @select(start + 1, end)
    @replace(left + @text + right, selectAfter)
    @select(savedSelection.start + left.length, savedSelection.end + left.length) if reselect


  unWrapLine: (left, right, selectAfter = true, reselect = false) ->
    @getDetails()
    savedSelection = @serialize()
    text = @element.val()
    start = text.lastIndexOf('\n', @start)
    end = text.indexOf('\n', @end)
    end = text.length if end < start
    start = text.lastIndexOf('\n', @start - 1) if text[start] == '\n'
    @select(start + 1, end)
    window.something = @text
    leftRegExp = new RegExp("^#{left.regExpEscape()}")
    rightRegExp = new RegExp("#{right.regExpEscape()}$")
    changed = @replace(@text.replace(leftRegExp, '').replace(rightRegExp, ''), selectAfter)
    @select(savedSelection.start - left.length, savedSelection.end - left.length) if reselect && changed


  addList: (content) ->
    text = @element.val()
    start = text.lastIndexOf('\n', @start)
    end = text.indexOf('\n', @end)
    end = text.length if end < start
    start = text.lastIndexOf('\n', @start - 1) if text[start] == '\n'
    @select(start + 1, end)
    lines = @text.split('\n')
    @replace("#{content} " + lines.join("\n#{content} "), true)


  deselectNewLines: ->
    text = @text
    length = text.replace(/\n+$/g, '').length
    @select(@start, @start + length)


  placeMarker: ->
