Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update Commands/Bibliography Completion.plist

BUGFIX: TextMate 2 failed to show all available references when carat is located between a pair of empty curly braces after a cite command
  • Loading branch information...
commit f95d2b89d1a030145e768743bb5a5e64e617ba7f 1 parent ef4897e
@jimmyti jimmyti authored infininight committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 Commands/Bibliography Completion.plist
View
4 Commands/Bibliography Completion.plist
@@ -13,7 +13,9 @@ phrase = STDIN.read.chomp
include LaTeX
begin
items = LaTeX.get_citations.map{|i| i.citekey + " % "+i.description}
- items = items.grep(/#{phrase}/) if phrase != ""
+ if ((phrase != "") && (phrase != "{}"))
@sorbits Owner
sorbits added a note

This introduces & as a literal character in an XML file — it no longer parses as a valid property list!

/cc @infininight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ items = items.grep(/#{phrase}/)
@duhalde
duhalde added a note

I beleive you mistakingly replace the surrounding carets. In my opinion they should still be there around the inserted cite-key:
\cite{} -> cite{cite-key}, while right now I end up with \citecite-key, unless I do a search for a part of a cite-key, like this:
\cite{ey} -> \cite{cite-key}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ end
TextMate.exit_discard if items.empty?
if items.length > 1
choice = TextMate::UI.menu(items)

1 comment on commit f95d2b8

@duhalde

I beleive you mistakingly replace the surrounding carets. In my opinion they should still be there around the inserted cite-key:
\cite{} -> cite{cite-key}, while right now I end up with \citecite-key, unless I do a search for a part of a cite-key, like this:
\cite{ey} -> \cite{cite-key}.

@sorbits

This introduces & as a literal character in an XML file — it no longer parses as a valid property list!

/cc @infininight

@sorbits
Owner

Based on the comment by @duhalde a better fix might be to change the scope selector so that only the content is passed to the command (which then doesn’t have to worry about surrounding braces).

It also appears that label completion (\ref{‸}) is affected (mailing list post).

@infininight Was there a recent scope change that may have caused these issues (don’t see any)?

Please sign in to comment.
Something went wrong with that request. Please try again.