anchor.diff:            }
           } else if(e.which == 46) {
             // don't do anything if cursor is at the end
  -          if(_element.selectionStart != _length) {
  +          if(_element.selectionStart != _element.maxLength) {
               // insert a space after the character that will be deleted by the delete
               _element.setRangeText(" ", _element.selectionStart+1, _element.selectionStart+1);
             }
  
positive.code:     _element.onKeyPress.listen((Event e) {
        Logger.root.info("overwrite got key press");
        // if cursor is at end, move it back one
        if(_element.selectionStart == _length) {
          _element.selectionEnd = _element.selectionStart = _length - 1;
        }
        // save the cursor position
        int cursor = _element.selectionStart;
  
negative.code: class Overwrite {
    // the element to implement overwrite mode in
    TextAreaElement _element;
    
    /// Create an overwrite object that implements overwrite mode on the input element 
    Overwrite(TextAreaElement this._element) {
      // set max length of element text to current length
      // TODO this should be set more intelligently
      _element.maxLength = _element.value.length;
      _element.onPaste.listen((Event e) {
        // remove enough characters to make room for pasted text
        _element.setRangeText("", _element.selectionStart, _element.selectionStart + e.clipboardData.getData("Text").length, "start");
      });
      _element.onCut.listen((Event e) {
        // create a string of spaces the same length as the text that will be cut
  