 	//called when text editing has ended
 	func textStorage(textStorage: NSTextStorage, didProcessEditing editedMask: NSTextStorageEditActions, range editedRange: NSRange, changeInLength delta: Int)
 	{
+		guard !ignoreTextStorageNotifications else { return }
 		//we don't care if attributes changed
 		guard editedMask.contains(.EditedCharacters) else { return }
 		guard parser != nil else { return }

	private var openDocuments:[Int:EditorDocument] = [:]
	private var defaultAttributes:[String:AnyObject]! //set in viewDidLoad, never used unless loaded
	private var currentChunkIndex = 0
	
	private var myFontDescriptor:NSFontDescriptor?
	

				openDocuments[theFile.fileId] = currentDocument!
			}
			currentDocument!.willBecomeActive()
			ignoreTextStorageNotifications = true
			storage.deleteCharactersInRange(editor!.rangeOfAllText)
			parser = SyntaxParser.parserWithTextStorage(storage, fileType: theFile.fileType)
			ignoreTextStorageNotifications = false
			storage.setAttributedString(NSAttributedString(string: theText, attributes: defaultAttributes))
			if oldDocument?.dirty ?? false {
				let prog = oldDocument!.saveContents()
