anchor.diff:      }
     }
   
  -  _stripWhitespace() {
  -    html.Point cursorPosition = aceManager.cursorPosition;
  -    RegExp whitespaceRegEx = new RegExp('[\t ]*\$', multiLine:true);
  -    _session.value = _session.value.replaceAll(whitespaceRegEx, '');
  -    aceManager.cursorPosition = cursorPosition;
  +  void _stripWhitespace() {
  +    String currentText = _session.value;
  +    String newText = currentText.replaceAll(whitespaceRegEx, '');
  +    if (newText != currentText) {
  +      _replaceContents(newText);
  +    }
     }
   
     /**
  
positive.code:     // notification (in fileContentsChanged()), we compare the last write to the
      // contents on disk.
      if (_dirty) {
        // Remove the trailing whitespace if asked to do so
        // TODO(ericarnold): Can't think of an easy way to share this preference,
        //           but it might be a good idea to do so rather than passing it.
        if (stripWhitespace) _stripWhitespace();
  
negative.code: export 'package:ace/ace.dart' show EditSession;
  
  class TextEditor extends Editor {
    static final RegExp whitespaceRegEx = new RegExp('[\t ]*\$', multiLine:true);
  
    final AceManager aceManager;
    final workspace.File file;
  
  