 			@$scope.$watch "editor.wantTrackChanges", (value) =>
 				return if !value?
 				@_syncTrackChangesState(@$scope.editor.sharejs_doc)
+
+		showRichText: () ->
+			if !window.richTextEnabled
+				return false
+			@localStorage("editor.mode.#{@$scope.project_id}") == 'rich-text'
 
 		autoOpenDoc: () ->
 			open_doc_id = 

				opening: true
				trackChanges: false
				wantTrackChanges: false
				showRichText: localStorage("editor.mode.#{@$scope.project_id}") == 'rich-text'
			}

			@$scope.$on "entity:selected", (event, entity) =>

	"ide/editor/controllers/SavingNotificationController"
], (Document) ->
	class EditorManager
		constructor: (@ide, @$scope, @localStorage) ->
			@$scope.editor = {
				sharejs_doc: null
				open_doc_id: null
