And here it is:
https://github.com/mattneub/AsciiDoc-TextMate-2
I would like to thank everyone (meaning Allan in particular) for so much hand-holding. I truly couldn't have done it without you.
(That's partly because, even after all this time, the state of documentation on how to write a grammar is startlingly inadequate; if I have time, I intend to write a public document providing some lessons learned.)
In conclusion I would like to repeat some suggestions about possible improvements to grammars, that would have helped me a lot:
* "exclude" in addition to the existing "include". This would allow me to include a batch of rules by a single name and then exclude the few that should _not_ be included.
* Peekahead. This is the setext problem, but it arises in a lot of areas of AsciiDoc. Despite concerns over speed and the problems of backtracking, it might be that the mere ability to examine _just the next line_ might all by itself be helpful without slowing things down too much, i.e. no, the next line is not a match for the "next" pattern, so *this* line is not a match for the "begin" pattern, and on we go to the next line.
* "include" should limit the search. You will recall that the problem I had is this (because AsciiDoc paragraphs can consist of multiple lines):
This (1) is a paragraph *consisting of
multiple lines* and containing a stretch of bold.
This (2) is a paragraph with * an asterisk in it.
This (3) is another paragraph with * an asterisk in it.
Now, I can sort of pick out the paragraphs here by the fact that they are bounded by more than one return character. But if I code my "bold" rule as a begin-end rule, it picks up not only the bold in the paragraph 1 but (wrongly) a bold stretching from paragraph 2 to paragraph 3, _even if "bold" is an include within "paragraph"_. Indeed, TextMate extended the containing "paragraph" to include both 2 and 3 just in order to allow the "bold" to grow. Therefore I just had to give up and pick out neither. But what TextMate was doing here seems wrong to me and it would be nice if it wouldn't do that.
Still, what I ended up with is more than acceptable and definitely useful. Now that I can edit my books with it, I am able to move forward and adopt TextMate 2 full-time! m.
--
matt neuburg, phd = matt(a)tidbits.com, http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do
iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
Hi.
I'm using the default bundle for Java and would like to modify it so that the console output is displayed as plain text in a tool tip, as Venkat is doing here:
http://www.youtube.com/watch?v=7vYr12vlwrA#t=329
When I edit the Compile & Run Menu Action to show the output in tool tip and set the format to text the console output is indeed shown in a tool tip but it's shown as HTML. How do prevent TextMate from generating HTML in this case?
Thanks in advance!
/ Fredrik
Lets say I search for all periods (.) in a paragraph. I can do this using
OPTION+CMD+F, which places multiple carets over each period. Is there a
keyboard shortcut to remove the multiple carets and to get back to just one
caret?
Thanks
Ross
In the Find Dialog, you can toggle regex with Cmd-Option-R. Seems like we
used to be able to toggle Ignore case with Cmd-Option-I, but this no longer
works. That keyboard sequence toggles invisible characters.
Are there shortcuts for the other items in the Find Dialog?
Here's a list of includes from one of the inline patterns in the AsciiDoc grammar I'm writing:
{ include = '#double_bold'; },
{ include = '#double_italic'; },
{ include = '#double_literal'; },
{ include = '#double_unquoted'; },
{ include = '#double_quote'; },
{ include = '#single_bold'; },
{ include = '#single_italic'; },
{ include = '#single_literal'; },
{ include = '#single_literal_nopassthru'; },
{ include = '#single_unquoted'; },
{ include = '#superscript'; },
{ include = '#characters'; },
But it happens that that list is almost the same as the #inline group I've already defined. I could reduce this to a single include! There's just one problem: we must not include ourselves, i.e. #subscript; we crash if we do, and anyway it's wrong (this pattern is not in any way recursive). Thus I request that the grammar should allow me to talk like this:
{ include = '#inline'; },
{ exclude = '#subscript'; },
This is not just to make the list shorter; it also makes the list more correct and coherent, because I'm allowed to say (and see) exactly the truth: "include everything except yourself".
Thanks for thinking about this - m.
--
matt neuburg, phd = matt(a)tidbits.com, http://www.apeth.net/matt/
pantes anthropoi tou eidenai oregontai phusei
Programming iOS 7! http://shop.oreilly.com/product/0636920031017.do
iOS 7 Fundamentals! http://shop.oreilly.com/product/0636920032465.do
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
Is it possible to set the default theme for a given folder by setting the
.tm_properties file? I know I've seen reference to it but I also think I
remember hearing that this wasn't implemented yet. I'm VERY interested in
either:
- Per directory defaulting of Theme (via above .tm_properties or any
other method)
- Per grammer/language defaulting of Theme
If these features aren't currently available I'd like to put my vote in for
them ... they seems quite generally applicable to the populations use-cases
and I would imagine (speaking completely out of school) them to not be
terribly hard to implement? Here's me hoping anyway.
Ken
On 6 Feb 2014, at 9:50, Kevin Owens wrote:
> I'm getting, what to me is unexpected behavior, from the command that
> says "Send Selection/Line to" and in the sub-menu says "R.app & Step"
> (this is the one that has the default key binding of
> option+shift+enter. Here is the code in my bundle: […]
First, update to v2.0-alpha.9509 (current nightly build).
Then for the last part, it should be:
if [ "$TM_LINE_NUMBER" != "" ]; then
"$TM_MATE" -l "$(($TM_LINE_NUMBER+1)):1000000"
elif [[ $TM_SELECTION =~ [1-9][0-9]*:?[0-9]*-([1-9][0-9]*):?[0-9]* ]];
then
# Regular Selection
"$TM_MATE" -l "$((${BASH_REMATCH[1]}+1)):1000000"
elif [[ $TM_SELECTION =~ [1-9][0-9]*:?[0-9]*x([1-9][0-9]*):?[0-9]* ]];
then
# Block (option) selection
"$TM_MATE" -l "$((${BASH_REMATCH[1]}+1)):1000000"
else
"$TM_MATE"
fi
> The command that says ""Send Selection/Document to" in the sub-menu
> R.app (default keybinding command+option+shift+R) also sends focus to
> R.app.
For this command, I think you can simply add "$TM_MATE" on a (new) last
line.
Hi,
I’m running v2.0-alpha.9503 under OS X 10.9, and habitually view it full screen (ctrl-cmd-f). However I call up the Find/Replace dialog (e.g cmd-f), the editing window turns invisible. This makes the Next button (among others) highlight matches in an invisible document (try it and you’ll see what I mean). No such problem if I exit full screen (ctrl-cmd-f again) before I call up the Find/Replace Dialog. I thought you’d want to be aware of this behaviour.
Regards
Robert Milton
Allan,
I solved the problem. In my Mac-side SSH configuration (OS X 10.8.4), I had
AddressFamily inet
listed in my .ssh/config. This limits ssh connections to using IPv4. If I disable that, then it works fine. For some reason the change to allowing IPv6 in TextMate in conjunction with the above openssh option fails. Disabling the AddressFamily line makes it work.
Related, I had "disabled" IPv6 on my Mac networking by setting it to "local link-only". It still works with that, but I get an error message on the server side from rmate:
setsockopt TCP_NODELAY: Invalid argument
This error goes away by changing IPv6 to "Automatic" in the Mac network settings.
So, it appears that the change to allowing for IPv6 actually requires it to be present.
Cheers,
Brian
> TextMate did switch to using IPv6 API instead of IPv4, but for me the
> above works w/o issues, I tried with TextMate listening for both local
> and remote clients, tried setting up tunnel via command line and
> ~/.ssh/config, all cases for me was a success.
>
> This is on OS X 10.8.4 using OpenSSH_5.9p1, OpenSSL 0.9.8x 10 May 2012
> (the one in /usr/bin) and network has an IPv4 IP (obtained via DHCP) but
> no IPv6 IP (config set to ?automitcally? which gives me no values
> for the IPv6 things in network settings).
>
> Any mismatch in environment?