mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-18 21:12:50 +00:00
fixing environment duplication in autocomplete issue
This commit is contained in:
parent
d1b906db43
commit
42be1164bc
1 changed files with 19 additions and 4 deletions
|
@ -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,10 +137,11 @@ define () ->
|
||||||
result = []
|
result = []
|
||||||
iterations = 0
|
iterations = 0
|
||||||
while match = re.exec(text)
|
while match = re.exec(text)
|
||||||
result.push {name: match[1], whitespace: match[2]}
|
if match[1] not in environmentNames
|
||||||
iterations += 1
|
result.push {name: match[1], whitespace: match[2]}
|
||||||
if iterations >= 1000
|
iterations += 1
|
||||||
return result
|
if iterations >= 1000
|
||||||
|
return result
|
||||||
return result
|
return result
|
||||||
|
|
||||||
class EnvironmentManager
|
class EnvironmentManager
|
||||||
|
|
Loading…
Reference in a new issue