소스 검색

Fix bug where cursor position wouldn't be saved when switching documents

This was caused by an underlying bug/poor optimisation where the aceEditor
directive would be reconstructed every time when switching between documents.
This wiped instances like CursorPositionManager which relies on keeping state
between doc changes.

Now the directive is only removed when switching between Ace and CM. This
prevents other potential bugs and improves performance.
Alasdair Smith 8 년 전
부모
커밋
fafbbfef87
1개의 변경된 파일과 5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      services/web/app/views/project/editor/editor.pug

+ 5 - 3
services/web/app/views/project/editor/editor.pug

@@ -36,7 +36,8 @@ div.full-size(
 
 		#editor(
 			ace-editor="editor",
-			ng-if="!!editor.sharejs_doc && !editor.opening && !editor.richText"
+			ng-if="!editor.richText",
+			ng-show="!!editor.sharejs_doc && !editor.opening",
 			theme="settings.theme",
 			keybindings="settings.mode",
 			font-size="settings.fontSize",
@@ -69,8 +70,9 @@ div.full-size(
 
 		if hasFeature('rich-text')
 			#editor-rich-text(
-				cm-editor
-				ng-if="!editor.opening && editor.richText"
+				cm-editor,
+				ng-if="editor.richText"
+				ng-show="!!editor.sharejs_doc && !editor.opening"
 				sharejs-doc="editor.sharejs_doc"
 			)