Преглед изворни кода

Add the custom environments to the list of snippets

Shane Kilkelly пре 10 година
родитељ
комит
eebd25351d

+ 14 - 1
services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SnippetManager.coffee

@@ -115,6 +115,19 @@ define () ->
 			docText = session.getValue()
 			docText = session.getValue()
 			customEnvironmentNames = parseCustomEnvironmentNames(docText)
 			customEnvironmentNames = parseCustomEnvironmentNames(docText)
 			# console.log customEnvironmentNames
 			# console.log customEnvironmentNames
-			callback null, staticSnippets
+			snippets = staticSnippets.concat(
+				customEnvironmentNames.map (name) ->
+					{
+						caption: "\\begin{#{name}}..."
+						snippet: """
+							\\begin{#{name}}
+							\t$1
+							\\end{#{name}}
+						"""
+						meta: "env"
+
+					}
+			)
+			callback null, snippets
 
 
 	return SnippetManager
 	return SnippetManager