Hi Allan,
It is truly wonderful to see so much activity again! I see so many improvements and am optimistic TM 2 will soon set the stage once again.
Here is my problem: I have continued to use TM 1, primarily the Latex bundle, because of one old snippet which does not work as it should in TM 2. I use it many times a day and would not like to give it up.
Here it is:
\( $0$TM_SELECTED_TEXT \)
Scope Selector: text.tex.latex
Key equivalent: $
In TM 1, the $ key outputs ( $0$TM_SELECTED_TEXT ). The curser is inside the math formula brackets ( ). It stays inside, regardless of what I write, until I type $ again. Then the cursor moves outside. That is just what I want it to do.
In TM 2, the $ key outputs ( $0$TM_SELECTED_TEXT ). The curser is inside the math formula brackets ( ). It stays inside, regardless of what I write, until I type $ again. Then I see ( ($0$TM_SELECTED_TEXT ) ) and the cursor is still inside. Not good!
If I erase the snippet, then in both TM 1 and TM 2, the same thing happens. Inputting $ the first time yields $ $0$TM_SELECTED_TEXT $. The second time, the cursor moves outside. This would be fine, except that many of us have moved away from using $ signs to set off equations in Latex.
Best regards,
Jenny
On Feb 7, 2013, at 11:01 PM, Jenny Harrison profharrison@gmail.com wrote:
[…] Here it is:
\( $0$TM_SELECTED_TEXT \)
Scope Selector: text.tex.latex
Key equivalent: $
In TM 1, the $ key outputs ( $0$TM_SELECTED_TEXT ). The curser is inside the math formula brackets ( ). It stays inside, regardless of what I write, until I type $ again. Then the cursor moves outside. That is just what I want it to do.
The “step two” of having ‘$’ inside the math brackets jump outside is likely done by a macro bound to ‘$’ and scoped to ‘string.other.math.latex’ because the snippet alone would not be able to do two different things depending on context.
You can however change it to something like:
\( ${1:$TM_SELECTED_TEXT} \)
This will allow you to use tab to “jump out”. Additionally it will keep the selected text selected (don’t know if you would consider that a feature or not).
You can also improve the scope selector to: text.tex.latex - string.other.math
That way its key equivalent will not fire when already inside a math string (you can also try this scope selector change alone, at least then you won’t get the snippet inserted again).
If I erase the snippet, then in both TM 1 and TM 2, the same thing happens. Inputting $ the first time yields $ $0$TM_SELECTED_TEXT $. The second time, the cursor moves outside. This would be fine, except that many of us have moved away from using $ signs to set off equations in Latex.
It does sound like you have a custom “jump out” function bound to ‘$’. You can use Bundles → Select Bundle Item… then switch to “All Scopes” and “Key Equivalent”. Now press ‘$’ to see a list of everything bound to that key. Although it’s really 1.x where you want to perform this search (which doesn’t have the “All Scopes” option, but you can open up the window while the caret is inside math brackets, and it should search that scope).