Просмотр исходного кода

add extra delay to gotoLine event

Brian Gough 10 лет назад
Родитель
Сommit
daa1d80865
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      services/web/public/coffee/ide/editor/EditorManager.coffee

+ 5 - 2
services/web/public/coffee/ide/editor/EditorManager.coffee

@@ -46,8 +46,11 @@ define [
 
 
 			done = () =>
 			done = () =>
 				if options.gotoLine?
 				if options.gotoLine?
-					@$scope.$broadcast "editor:gotoLine", options.gotoLine, options.gotoColumn
-			
+					# allow Ace to display document before moving, delay until next tick
+					setTimeout () =>
+						@$scope.$broadcast "editor:gotoLine", options.gotoLine, options.gotoColumn
+					,0
+
 			if doc.id == @$scope.editor.open_doc_id and !options.forceReopen
 			if doc.id == @$scope.editor.open_doc_id and !options.forceReopen
 				@$scope.$apply () =>
 				@$scope.$apply () =>
 					done()
 					done()