I'm still trying to get started writing my bundle, but I can't even get the first two rules to work...
AsciiDoc marks bold like *this*, but I don't want this to work across paragraph boundaries. I've started by arbitrarily dividing the document into paragraphs:
patterns = (
{ name = 'punctuation.test';
begin = '^';
end = '$';
},
);
I've marked 'punctuation.test' as red, so I can see that this is working.
====
This is a paragraph
And this is a different paragraph
====
In the repository, I also define bold; the real pattern is quite involved, but let's pretend it's very simple, like this:
repository = {
single_bold = {
name = 'markup.bold.asciidoc';
begin = '\*';
end = '\*';
};
};
Now I include single_bold in my punctuation.test paragraph, by changing the patterns to look like this:
patterns = (
{ name = 'punctuation.test';
begin = '^';
end = '$';
patterns = (
{ include = '#single_bold'; },
);
},
);
This screws everything up. Yes, it works on expressions like *this*. But it also works across paragraph boundaries:
====
Like *this
it boldifies* across paragraphs.
====
That is exactly what I wanted to prevent! What is happening, as I can see from my red "punctuation.test", is that including #single_bold in punctuation.test is actually changing the meaning of punctuation.test! Instead of stopping after "Like *this", the way it did before, punctuation.test is now mysteriously extended to included multiple paragraphs.
What I want to do is give the paragraph definition _priority_ so that #single_bold only works _inside_ a paragraph; instead, including #single_bold is causing the paragraph definition to stop working correctly and is extending both itself and the paragraph definition across multiple paragraphs. How do I prevent that? Or how do I make a begin/end rule that doesn't cross line boundaries? Thanks! 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
I just quit TextMate 2 with an untitled dirty document open, and TextMate forgot to offer to save it - it simply vanished off the screen and the work was lost. I don't blame TextMate; if I really wanted that script, I should have saved it at some point. But I'm just warning people, there's a bug in there that can allow this to happen (though I am completely unclear on what the circumstances are; it's not like this bug is easily reproduced or anything). Don't assume you'll get the Save dialog on quit. 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
One of the coolest things about the bundle development process is that a grammar is "live". If you have a document open that comes under this grammar, and if you make a change in the grammar and save, the grammar is immediately applied freshly to the open document.
Unfortunately, this is _not_ true of custom themes. Let's say I have a custom theme in this same bundle (Test Theme). And let's say it contains this setting (among others):
{ name = 'Test';
scope = 'punctuation.test';
settings = { background = '#FF0000';};
}
I'm sure you can see where this is going. My idea here is to make a grammar-defined scope visible temporarily (for testing and analysis) by renaming it "punctuation.test" just long enough to let the theme color its background in the document, so I can see whether my scope is working correctly.
But this doesn't work. Well, it works, but every time I make a change in Test Theme, I have to apply that theme to the document _again_ (bring the document to the front and choose View > Theme > Test Theme) even though that theme is _already_ applied to this document (it is already checked at the time I choose it in the menu).
So what I'm suggesting is: please make themes "live" in the same way as bundle grammars: when I save a theme, it should be immediately and visibly applied to any open documents to which it is already applied. This would make the development process a lot snappier. Thanks! 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
I have a file consisting of a single column of dollar amounts such as:
$172.83
$30.00
$74.36
$10.00
$528.33
$225.00
$107.78
$30.00
$74.36
$10.00
$61.85
$61.85
$18.70
$18.70
.
.
.
I need to transform this file into a file consisting of two columns with
the second column taken from every other of the single-column numbers. How
can I do that in TM2? I have looked in the manual and online for tips but
can not find any that do what I want, or so it seems. Can you guys please
suggest how to do this?
Thanks very much.
Comer
Let's say I've carefully set up a Regex find in the Find dialog. And let's say I switch away from TextMate to do something else, and I do a find, say in a Safari page. When I come back to TextMate, my find term is gone! It has been replaced from the system shared Find clipboard. This (the shared Find clipboard) is a vile feature and TextMate should either opt out or should give me a pref to opt out. Thanks! 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
(I signed up to get emails in a digest, so I don't know how to reply to
an individual email)
Message: 1
Date: Thu, 16 Jan 2014 21:15:59 +0700
From: "Allan Odgaard"<mailinglist(a)textmate.org>
To: "TextMate users"<textmate(a)lists.macromates.com>
Subject: [TxMt] Re: when sending code to R.app textmate 1 and 2 both
open
Message-ID:<4E4D9C0E-7389-4E8E-AFF5-4FC9DFA68AF7(a)textmate.org>
Content-Type: text/plain; charset=utf-8; format=flowed
On 15 Jan 2014, at 12:44, Kevin Owens wrote:
> I'd like to have both versions of textmate on my computer, but when I
> send code to the R.app in either, it shifts focus to the other one.
> For example, if I am running textmate 1 it runs the R code, then
> shifts focus to textmate 2, and then I have to alt tab to get back to
> my original window.
Exactly what bundle command are you using?
I looked at the commands in the R Console (R.app) bundle (like ?Send
Document / Selection to R.app?) and while I see code that activates
R.app I see no code to bring back focus to TextMate.
I'm using the command "Send Selection/Line To" and the sub-menu is "R.app and step" and the key binding is alt shift enter.
I've restarted my computer, and now it seems that Textmate 1 works fine, but it's when I send code to R.app that it switches focus.
I think it may be related to the lines in that command like
"open "txmt://open?line="
I’m trying to add some missing functionality to a bundle and stumbled upon some odd behavior of the selection string in TM_SELECTION regarding the range…
When I select a block of text and my cursor is somewhere in the middle of a line, the selection string contains exactly the highlighted range. Consider the following selection (see screenshot):
TM_SELECTION is now "5:5-3”, so lines 3-5 are included.
Example 2, column selection:
TM_SELECTION is “5x3”, lines 3-5 included.
But whenever I’m using CMD-L for “Select line”, like here, it gets somewhat problematic:
TM_SELECTION is now "6-3”, the range now includes line 6, but the *visible* part of the selection is still 3-5.
I can work somewhat around this checking if the last character in TM_SELECTED_TEXT is a newline (\n) (because that is where the additional line in the range is coming from - as one can make the same selection in example 3 when the cursor is on the first row of line 6, holding shift and hitting UP 2 times. Standard OSX behavior).
But the more I think about it, the less I’m sure if this is intentional.
Can this be considered a bug or is it intended behavior / a feature?
I'd like to have both versions of textmate on my computer, but when I
send code to the R.app in either, it shifts focus to the other one. For
example, if I am running textmate 1 it runs the R code, then shifts
focus to textmate 2, and then I have to alt tab to get back to my
original window.
I tried moving and renaming one .app, but it didn't work.
Kevin
In the archive I found this conversion:
>> Looking for help with language grammar. Coding in perl, and adding
>> pod (documentation) within a codeblock, pod code gets automatically
>> indented. Is there a way to have lines that begin with a = symbol
>> auto- 'out-dent'? And then any subsequent lines, before a '=cut' line
>> to be indented to match the previous line?
> I assume decrease indent only by a single unit? If so, you can make
> the line be matched by both the increase and decrease indent pattern,
> e.g.:
>
> increaseIndentPattern = '^\s*=\w+';
> decreaseIndentPattern = '^\s*=\w+';
>
> This should give the behavior. Note though that if the indent is zero
> when the cut line is used, the current build will not cause the indent
> to be increased for the following lines, but this will be fixed in
> next build.
>
> Also, we disable indent-as-you-type for source.comment, so if you
> setup useful indent patterns for the documentation blocks (which I
> assume are scoped as block comments) then it might be useful to
> re-enable indent-as-you-type:
>
> disableIndentCorrections = :false;
I am not sure, where to change these settings. In the Perl Bundle ->
Settings -> Indention? Or should I better make my own Bundle, so that
these Settings stick in case of an update?
Thanks in advance!