Better matching against keys.

Allows for successive matching as you type.
This commit is contained in:
Shane Kilkelly 2015-12-30 11:27:58 +00:00
parent 7aa8f3a5da
commit 3bd52f4aaf

View file

@ -49,7 +49,8 @@ define [
range = new Range(pos.row, 0, pos.row, pos.column)
lineUpToCursor = editor.getSession().getTextRange(range)
commandFragment = getLastCommandFragment(lineUpToCursor)
if commandFragment == '\\cite{'
# if commandFragment == '\\cite{'
if commandFragment.match(/^~?\\cite{\w*/)
result = references.keys.map (key) -> {
caption: "\\cite{#{key}",
snippet: "\\cite{#{key}",