fixing environment duplication in autocomplete issue

This commit is contained in:
Nate Stemen 2017-08-17 14:30:18 +01:00
parent d1b906db43
commit 42be1164bc

View file

@ -11,6 +11,20 @@ define () ->
"center" "center"
] ]
snippetNames = [
"array",
"figure",
"tabular",
"table",
"list",
"enumerate",
"itemize",
"frame",
"thebibliography"
]
environmentNames = snippetNames.concat environments
staticSnippets = for env in environments staticSnippets = for env in environments
{ {
caption: "\\begin{#{env}}..." caption: "\\begin{#{env}}..."
@ -123,6 +137,7 @@ define () ->
result = [] result = []
iterations = 0 iterations = 0
while match = re.exec(text) while match = re.exec(text)
if match[1] not in environmentNames
result.push {name: match[1], whitespace: match[2]} result.push {name: match[1], whitespace: match[2]}
iterations += 1 iterations += 1
if iterations >= 1000 if iterations >= 1000