소스 검색

Use existential operator to check existence

Shane Kilkelly 9 년 전
부모
커밋
96d269e348
1개의 변경된 파일과 3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee

+ 3 - 3
services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee

@@ -183,11 +183,11 @@ define [
 											editor.session.remove(right);
 											# trim the completion text to just the command, without braces
 											# example: '\cite{}' -> '\cite'
-											if matchData.snippet
+											if matchData.snippet?
 												matchData.snippet = matchData.snippet.replace(/[{\[].*[}\]]/, '')
-											if matchData.caption
+											if matchData.caption?
 												matchData.caption = matchData.caption.replace(/[{\[].*[}\]]/, '')
-											if matchData.value
+											if matchData.value?
 												matchData.value = matchData.value.replace(/[{\[].*[}\]]/, '')
 								# finally, insert the match
 								if matchData.snippet