SublimeText/LaTeXTools — pull request #120 by Westacular (2012-12-10 22:02:44+00:00)
Title: ref/cite completion: fixes and enhancements

I've made a bunch of refinements/refactoring to the ref and cite completion systems:

- For each of ref and cite, I've refactored the common code between the autocomplete plugin and the quick panel command into a single shared function.
- Fixed an issue where the commands would crash if the current file is unnamed and unsaved.
- Fixed various cases where the completion would generate an extra leading backslash, or a missing closing brace, etc.
- Changed the ref/cite dispatching command so that it directly uses the actual regexes used internally in the ref and cite functions to determine which, if any, to use. (Previously the dispatcher function was too restrictive, and would reject otherwise valid usage scenarios.)
- Make the autocomplete plugins less eager (see [Issue 118](see: https://github.com/SublimeText/LaTeXTools/issues/118)), so that they don't make unwanted modifications to the text if the user is in the middle of typing something else.
- Enhanced cite completion to work with multiple, comma-separated references in a single \cite{} command. (I didn't do this for ref, since most ref commands do not work with a list of multiple references.)
- Changed ref completion so that it will also work when other known ref commands are used (e.g. pageref, autoref, cref, etc.).
- Added keybinding for "{" and "," such that, if they are typed in very specifically appropriate contexts (e.g., "{" following "\ref"), they will automatically open the appropriate completion menu. This feature can be disabled by adding `"disable_latex_ref_cite_auto_trigger": true` to your user preferences.
- Incorporated [jlegewie's options](https://github.com/SublimeText/LaTeXTools/pull/92) for customizing the format of the citation quick panel.