   #   @param [String] content the initial content to set
   #
   val: (content)->
-    if content?
+    if not _.isUndefined(content)
       # reset styles when replacing content
       @_rte.words = []
       @_rte.style = []

  # @param [String] content the content to insert
  #
  insert: (sel, content)->
    if not sel.startPos?
      throw new Error "Expected a location object as first argument"
    if typeof content isnt "string"
      throw new Error "Expected a string as second argument"

    n = sel.startPos.word
    pos = sel.startPos.pos
    word = @getWord(n)
    @setWord(n, word.substring(0, pos) + content + word.substring(pos))

  # Relative jump from position
  #

_ = require 'underscore'

splitWord = word ->
  word.match(/(^ +|)\W+ +/g)


buildWord = (word, prepend='', append='') ->
  tmp = word.match /(^ +|)\W+ +/g
  tmp2 = []

  if tmp.length == 1
