소스 검색

prevent spell check from running twice on doc load

Henry Oswald 12 년 전
부모
커밋
a2f99bc04f
1개의 변경된 파일과 3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      services/web/public/coffee/ide/editor/directives/aceEditor/spell-check/SpellCheckManager.coffee

+ 3 - 3
services/web/public/coffee/ide/editor/directives/aceEditor/spell-check/SpellCheckManager.coffee

@@ -19,7 +19,7 @@ define [
 				@runCheckOnChange(e)
 
 			@editor.on "changeSession", (e) =>
-				@runFullCheck()
+				@runSpellCheckSoon(200)
 
 				e.oldSession?.getDocument().off "change", onChange
 				e.session.getDocument().on "change", onChange
@@ -100,14 +100,14 @@ define [
 				end: cursor
 			return highlight
 
-		runSpellCheckSoon: () ->
+		runSpellCheckSoon: (delay = 1000) ->
 			run = () =>
 				delete @timeoutId
 				@runSpellCheck(@updatedLines)
 				@updatedLines = []
 			if @timeoutId?
 				clearTimeout @timeoutId
-			@timeoutId = setTimeout run, 1000
+			@timeoutId = setTimeout run, delay
 
 		markLinesAsUpdated: (change) ->
 			start = change.range.start