mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Don't return current prefix in auto-complete list
This commit is contained in:
parent
06831e555e
commit
f781001280
1 changed files with 8 additions and 10 deletions
|
@ -1,6 +1,4 @@
|
||||||
define [
|
define [], () ->
|
||||||
"auto-complete/commands"
|
|
||||||
], (commands) ->
|
|
||||||
class Parser
|
class Parser
|
||||||
constructor: (@doc) ->
|
constructor: (@doc) ->
|
||||||
|
|
||||||
|
@ -70,7 +68,7 @@ define [
|
||||||
doc = session.getValue()
|
doc = session.getValue()
|
||||||
parser = new Parser(doc)
|
parser = new Parser(doc)
|
||||||
commands = parser.parse()
|
commands = parser.parse()
|
||||||
|
|
||||||
completions = []
|
completions = []
|
||||||
for command in commands
|
for command in commands
|
||||||
caption = "\\#{command[0]}"
|
caption = "\\#{command[0]}"
|
||||||
|
@ -84,12 +82,12 @@ define [
|
||||||
snippet += "{${#{i}}}"
|
snippet += "{${#{i}}}"
|
||||||
caption += "{}"
|
caption += "{}"
|
||||||
i++
|
i++
|
||||||
|
unless caption == prefix
|
||||||
completions.push {
|
completions.push {
|
||||||
caption: caption
|
caption: caption
|
||||||
snippet: snippet
|
snippet: snippet
|
||||||
meta: "cmd"
|
meta: "cmd"
|
||||||
}
|
}
|
||||||
|
|
||||||
callback null, completions
|
callback null, completions
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue