I have this piece of language grammar to match a struct in D :
begin = '(?x)^\s*
((?:\b(public|private|protected|static|final|synchronized|abstract|export|shared)\b\s*)*)
# modifier
(struct)\s+
(\w+)\s* # identifier
(?:\(\s*([^\)]+)\s*\)|)\s* # Template type
(if\s*\(\s*([^\)]+)\s*\)|)?\s* # Template constraint
';
end = '(?={|;)';
It will match this code, as an example:
struct Foo(A) if (true)
{
}
The problem is if I put the "if" on a new line it won't match. How can I
make the rule match across several lines?
--
/Jacob Carlborg
I've tried 'latex and view' again and it does now start up faster than I remember!
Thanks for the great work,
Geoff
>> On 24 Mar 2015, at 13:32 , Geoff Vallis <gkvallis(a)gmail.com> wrote:
>>
>> Hi Ren,
>>
>> Your fix did the trick, thanks very much.
>>
>> The reasons I don't use 'typeset and view' are twofold. The main one is just that it is a bit slow - I have to wait almost five seconds before it actually starts to typeset, which may not seem very long but when I am 'debugging' it is a little frustrating. Using a terminal window the typesetting starts instantly.
>
> Commit 39b09967 [1] should improve the startup time of `texmate` significantly.
>
> [1]: https://github.com/textmate/latex.tmbundle/commit/39b09967
>
> I get an overhead of less than 0.3s if I use `texmate` on a minimal file. The translation of the minimal file inside Terminal using the command `time pdflatex tmp.tex` takes 0.55s. The following command ? basically simulating a run of ?Typeset & View (PDF)? ? inside TextMate takes about 0.79s:
>
> ?
> #!/usr/bin/env bash
>
> BUNDLE_DIR="$HOME/Library/Application Support/Avian/Bundles/LaTeX.tmbundle"
> TM_BUNDLE_DIR="$HOME/Library/Application Support/TextMate/Managed/Bundles"
>
> export TM_FILEPATH="tmp.tex"
> export TM_SUPPORT_PATH="$TM_BUNDLE_DIR/Bundle Support.tmbundle/Support/shared"
> export TM_BUNDLE_SUPPORT="$BUNDLE_DIR/Support"
> export PATH="$BUNDLE_DIR/Support/bin":$PATH
> export TM_SELECTION='1:1'
>
> texmate.py -suppressview latex -latexmk no -engine pdflatex
> ?
>
> tmp.tex:
> ?
> \documentclass{article}
>
> \begin{document}
> Bla
> \end{document}
> ?
>
> Could you maybe test the above example and send in your results. If it takes multiples seconds before `texmate` starts typesetting, then maybe your local copy of the bundle does not contain the changes done in commit 5074427f [2]?
>
> [2]: https://github.com/textmate/latex.tmbundle/commit/5074427f
>
>> The second reason is that I can go back and forth between xelatex and pdflatex easily by setting up two scripts with different keyboard shortcuts, which I find quite convenient.
>
> You can change the typesetting engine used by ?Typeset & View (PDF)? with the following commands:
>
> defaults write com.macromates.textmate.preview latexEngine xelatex
> defaults write com.macromates.textmate.preview latexEngine pdflatex
>
>> I know there are some advantages to 'typeset and view' and if it were a bit quicker, like the equivalent command in TexShop which is quite fast, I would use it.
>
> Hopefully the latest changes help.
>
>> Thanks again
>> Geoff
>
> Kind regards,
> Ren?
>
Hello,
I have just installed the latest security update on my Mac (10.10.2) and some commands in my latex bundle were broken by it. For example, I have a script (below) that opens a terminal window and typesets the master file, but after the security update the command no longer tries to typeset the master file, but the subfile, and hence typesetting fails. I am sure is is the Mac OS security update that led to the failure, because I tried on two Macs with the same behaviour.
Thanks for any help you may offer
Geoff
--------
#!/usr/bin/env bash
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
TM_LATEX_MASTER=`${TM_RUBY:-ruby} <<"RUBY"
require "#{ENV['TM_SUPPORT_PATH']}/lib/escape.rb"
require "#{ENV['TM_BUNDLE_SUPPORT']}/lib/LaTeXUtils.rb"
master = LaTeX.master(ENV['TM_LATEX_MASTER'] || ENV['TM_FILEPATH'])
puts master
RUBY`
FILE=${TM_LATEX_MASTER:-$TM_FILEPATH}
cd ${TM_DIRECTORY}
open -a iterm
/Users/gkv/scripts/iterm "time /usr/texbin/pdflatex -synctex=1 ${FILE%.tex}"
--------
The Watch Document command (Cmd-Ctrl-W) in the LaTeX bundle works beautifully either for a single TeX document or for a series of documents if started from the master file. Is it possible to tweak Watch Document so it can be called from any of these sub-files that are linked to the master?
--Gildas
As useful as the escape key is, it would be nice to have visual feedback for auto completion. What would it take to build this? I think Xcode does it best, but I have seen a few fledgeling editors like Textastic and Chocolat implement basic auto complete quite well in the early stages.
Thanks
-Sam
(I am sending this again as plain text email. Sorry about the earlier HTML email.)
This is all the rage these days: http://usetakana.com
It's a relatively new tool from mid-2014 it seems.
Live SCSS (SASS) editing with on the fly updates, and it's FAST since it happens via JavaScript in the browser and a server running in the background.
Can this be implemented in TM2?
It's currently only for Sublime Text. Problem is, I'm not a big fan of that editor. I'm forced to use it for this purpose only. If i could do this same thing in TM2 life would become fun again.
Hi,
Further to Andrew Jaffe’s message a couple of weeks ago, I’ve noticed since TM2 that⇧⌘A doesn’t work as well for Subversion as it did in TM1, or at least that Subversion Update doesn’t seem to work as expected if you⇧⌘A before it. In TM1 ⇧⌘A followed by ⌘Y Subversion Update would perform a full project update from the root directory. In TM2 it reports success, but never updates anything.
In fact you have to select the project root directory, which I do by click on the project folder (top-left) and selecting the parent folder, followed by clicking on the project folder again to select it from the list. Then ⌘Y Update works fine.
Am I being stupid or should ⇧⌘A,
⌘Y Update work as expected?
Cheers,
Jonathan Monahan