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?
I am running 2.0-alpha.9507 on OS X 10.9.1.
I first noticed this problem in the rails bundle whenever it requests to
create a new file.
I can recreate the issue with the following code:
require '/Users/curt/Library/Application
Support/TextMate/Managed/Bundles/Bundle
Support.tmbundle/Support/shared/lib/ui.rb'
TextMate::UI.request_confirmation(
:button1 => "Create",
:button2 => "Cancel",
:title => "Missing foo.rb",
:prompt => "Create missing foo.rb?"
)
Pressing Cmd-R results in:
ArgumentError: An object in the argument tree could not be converted
Here is the stack trace:
/Users/curt/Library/Application Support/TextMate/Managed/Bundles/Bundle
Support.tmbundle/Support/shared/lib/ui.rb:54:in `to_plist': An object in
the argument tree could not be converted (ArgumentError)
from /Users/curt/Library/Application
Support/TextMate/Managed/Bundles/Bundle
Support.tmbundle/Support/shared/lib/ui.rb:54:in `alert'
from /Users/curt/Library/Application
Support/TextMate/Managed/Bundles/Bundle
Support.tmbundle/Support/shared/lib/ui.rb:277:in `request_confirmation'
It is runing ruby version: 2.0.0-p247
Is this a known problem. Or perhaps a problem using Ruby 2.0?
I thought I understood how and where TM2 stores its bundles, but clearly not. I now discover that a bunch of bundles have spontaneously moved from /Application\ Support/TextMate/Managed/Bundles to /Application\ Support/Avian/Bundles, and some of them have even duplicated themselves:
/Application\ Support/TextMate/Managed/Bundles:
AppleScript.tmbundle Objective-C.tmbundle
Bundle Development.tmbundle PHP.tmbundle
Bundle Support.tmbundle Property List.tmbundle
C.tmbundle Python.tmbundle
CSS.tmbundle Ruby Haml.tmbundle
Diff.tmbundle Ruby on Rails.tmbundle
Git.tmbundle Ruby.tmbundle
HTML.tmbundle SCM.tmbundle
Hyperlink Helper.tmbundle SQL.tmbundle
JSON.tmbundle Shell Script.tmbundle
Java.tmbundle Source.tmbundle
JavaDoc.tmbundle Subversion.tmbundle
JavaScript jQuery.tmbundle TODO.tmbundle
JavaScript.tmbundle Text.tmbundle
Lua.tmbundle TextMate.tmbundle
Mail.tmbundle Textile.tmbundle
Make.tmbundle Themes.tmbundle
Markdown.tmbundle XML.tmbundle
Math.tmbundle YAML.tmbundle
Mercurial.tmbundle
/Application\ Support/Avian/Bundles:
AsciiDoc.tmbundle Make.tmbundle Ruby on Rails.tmbundle
HTML.tmbundle MattBundle.tmbundle RubyFrontier.tmbundle
Java.tmbundle Mercurial.tmbundle SQL.tmbundle
JavaDoc.tmbundle PHP.tmbundle Subversion.tmbundle
Lua.tmbundle Python.tmbundle Textile.tmbundle
Mail.tmbundle Ruby Haml.tmbundle YAML.tmbundle
Just what is really going on here? Thx - 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
Has anyone found a way to set a command to move to the right-edge in the middle of a soft-wrapped line in TM 2? I was using a macro called "Move to EOL" in TM 1 bound to command-right-arrow, but in TM 2 this takes me to the absolute end of the line.
In case it's not clear what I'm asking, I'd like to move the cursor from START to END in this single line of soft-wrapped text:
Lorem ipsum dolor sit amet, consectetur adipisicing
elit, sed do eiusmod START incididunt ut labore END
dolore magna aliqua.
Currently, in TM 2, if I do command-right-arrow the cursor ends up after "aliqua."
Thx,
--
Quinn Comendant
Strangecode, LLC
http://www.strangecode.com/
+1 530 624 4410 mobile
+1 530 636 2633 office
@qc and @strangecode
This may be related to the bundle problem that I reported earlier?
In the Ruby on Rails bundle is a command in the Support/bin directory
called
go_to_alternate_file.rb. This is the starting point for the script where I
am getting the to_plist error.
The first line of the this file is
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
so I would assume that it is being executed by ruby 1.8.
But if I modify the file and add the following line after the 'require'
statemets:
puts "${RUBY_VERSION}"
When the script is run, it prints 2.0.0 So it seems that the shebang line
is not being honored.
Am I missing something?
Hi,
I’m using Textmate on a 24” monitor in portrait mode. I often hide the file browser as it takes quite some screen real estate in portrait mode.
Unfortunately, since the newest automatic 'nightly build’ update (2.0-alpha.9505), when I change to another tab, the file browser reappears again rather than staying hidden.
Is there a setting or another way to avoid this happening?
Or, lacking that, is there a way to downgrade to the previous version?
Off topic: is there a open bug list available for textmate 2? I don’t see any on github.
Off topic 2: are there any tools available to search in the textmate mailing list archive, short of going manually through each month’s archive?
Thanks and regards,
Bas
The problem with the current begin-while is that it is not a true "while"; it can skip stuff. I request a begin-while construct which is anchored at the "begin" and, if it fails to find the "while" immediately after, gives up and moves on.
Example: Markdown permits a heading like this:
This is a Heading
=============
The problem is to match that entire thing, in particular both so that it can be theme-marked and so that "This is a Heading" can appear in the symbol list. At the moment, this can't be done. That fact is well proven by the fact that the Markdown bundle fails to do it. It's a clever bundle so if this were possible, it would be done correctly.
The reason it can't be done is three-fold:
(1) A "match" rule not only cannot span two lines, it can't even look ahead to the next line. Thus I can't express the notion "any line provided it is followed by a line starting with multiple equals signs", even though there is a perfectly good way to say that as a regular expression.
(2) A "begin"-"end" rule is both too narrow and too broad. It is too narrow because the "begin" rule suffers from the same limitation as the "match" rule: it cannot span two lines, and it cannot look ahead to the next line. It is too break because it just keeps going to the end of the document.
(3) A "begin"-"while" rule would work if only the "while" were taken seriously. For example, we could say this:
begin = '^\w.*?\s*$';
to mean "a line that starts with a word character and might end with some spaces". The trouble is that this matches almost any line in the world. What I'm asking is that the 'while' should pick right up on the next line, _and fail if it doesn't work_ (this is what "while" means in most programming languages, after all):
while = '^={6,}\s*$';
This works, but the trouble is that the negative works too: the resulting begin/while pattern matches every line of the document! This seems to be because the "begin" matches everything even though the "while" doesn't match anything.
That is why I am asking for a begin-while that takes the "while" seriously: after matching the "begin", if you can't match the "while", skip that "begin" and try again on the next line. Only succeed when the "begin" is actually *followed* by the "while".
Perhaps what I am actually asking for it "begin" "next" "next" or similar.
I can't believe this would be expensive, and it would solve a LOT of Asciidoc grammar problems, where there are many multi-line patterns such as this one.
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
Maybe a bug:
1. Do a multi-file search and replace,
2. bring the main window to the front (text windows with tabs),
3. save all windows (command-option-s),
4. and close the window.
You'll see the find window and its results below.
5. close this window
6. click "Save All" when you get the "Do you want to save the changes from your replace operation?" prompt.
7. Forever beach ball! Force-quit required.
Oh, wait—I just tried these steps again without trouble. So, maybe never mind? I'll let you know if it happens again.
Quinn
Please,
For the love of god, children and animals, can we please get indented soft
wrapping as a standard feature of Textmate 2. I just don't understand why
such a useful yet trivial feature that's common to just about every text
editor has not been included in what is supposed to be the holy grail of
text editors.
There's an 8 year old ticket for it, not to mention all the duplicates:
http://ticket.macromates.com/show?ticket_id=4EFB31A8
Do a google search for this, and you find people applying the same dodgy
fix to individual bundles; what a waste of time for everyone involves. Can
we not just get this feature added and be done with it.
Thanks,
Tom
Date: Fri, 17 Jan 2014 16:08:36 +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
Message-ID:<3D9202F3-4409-4616-8C91-022E216F188A(a)textmate.org>
Content-Type: text/plain; charset=utf-8; format=flowed
On 17 Jan 2014, at 11:13, Kevin Owens wrote:
> [?] I think it may be related to the lines in that command like
>
> "open"txmt://open?line="
Yes, that would go to whatever version of TextMate is responsible for
handling the txmt URL scheme.
The bundle should call ?mate? instead.
For 2.0 you can use:
"${TM_MATE}" -l ?line?:?column?
For a version that should work with both, use:
"${TM_MATE:-$TM_SUPPORT_PATH/bin/mate}" -l ?line?
If you can confirm this works, we can update the bundle accordingly.
______
I can confirm that this works. Here's the meat of what i changed:
if [ "$TM_LINE_NUMBER" != "" ]; then
open "${TM_MATE:-$TM_SUPPORT_PATH/bin/mate} -l ?line?&column=1000000" &
elif [[ $TM_SELECTION =~ [1-9][0-9]*:?[0-9]*-([1-9][0-9]*):?[0-9]* ]]; then
# Regular Selection
open "txmt://open?line=$((${BASH_REMATCH[1]}+1))&column=1000000" &
elif [[ $TM_SELECTION =~ [1-9][0-9]*:?[0-9]*x([1-9][0-9]*):?[0-9]* ]]; then
# Block (option) selection
open "txmt://open?line=$((${BASH_REMATCH[1]}+1))&column=1000000" &
else
open "txmt://open"
fi
Hello,
I’ m trying to clean the .nav, .snm, .mtc and .gz files which appear when i compile a latex document. I read that i have to modify the testate.py file but I don’t find it. Could you help me?
System : OSX 10.9.1
Texmate 2.0-alpha.9503
Best regards
PS : (sorry for the bad english)
.............................................................................................
jimmy ROUSSEL
Professeur de Physique
Responsable de l'interclassement
Ecole Nationale Supérieure de Chimie de Rennes
11 allée de Beaulieu CS 50837
35708 Rennes cedex 7, France
Université Européenne de Bretagne
Tel 33 (0)2 23 23 80 53
.............................................................................................
In TM2, the behavior of command-i is unexpected, and I believe different than in TM1.
Minimal example: Language grammar is LaTeX, cursor is at the pipe (|) in the following text, and I press command-i.
one | two
Expected result: one \emph{|} two
with cursor at pipe
Actual result: one\emph{ }|two
with cursor at pipe
Thanks, and I apologize if there’s a legitimate reason for this result which I don’t know about!
Christopher Eliot
Brooklyn, NY
Hi,
Along a thread similar to Kai Wood's comments on installing an external
bundle, I am trying to get the bundle for Julia working. To this end I have
now created the Pristine\ Copy subdir in ~/Library/Application Support/Avian/.
Then I created the subdir Bundles and then used the script:
#!/bin/sh
sudo cp -r Julia.tmbundle ~/Library/Application\ Support/Avian/Pristine\
Copy/Bundles
to copy the julia-supplied bundle to hopefully the right place. I then
restarted TM2 but did not see Julia on the bundles list. So I looked on the
Bundles list and Julia does not appear. However, when I go to Bundles->
Edit Bundles I see julia mentioned. Selecting that I only see an entry for
Language Grammars. The check for Enable This Item is already in place.
So, can you guys please help me get the Julia bundle usable?
Thanks very much.
Comer
I work on a few projects with symlinked directories and right now the lack of symlink support is the biggest thing keeping me on Textmate 1.
Symlinked files don’t show up in the Go To File (⌘+T) command, which makes one of my favorite features useless on some projects for me.
I know the FAQ also says that expanding symlinks currently doesn’t work in the File Browser- just curious if there’s an update for that? I tend to open files via ⌘+T and immediately ⌃⌘+R to reveal the file in the File Browser (would love for that to be automatic when you open a file).
Cheers!
-Philippe
When opening a document in a project that already has several tabs open, I find it very unpredictable where the new tab will go. It appears somewhere in the middle of the other tabs, and seems to disturb their order. Moreover, if I open a document whose tab is already open, it moves within the order of tabs.
All of that seems wrong and confusing, and makes it hard to keep track of which tab is which (because the order keeps changing so there is no positional memory). I would like to see the rule be:
* A document that is not already open, opens as the *first* tab. (I would really like it to be last, but that does not seem feasible because there might be too many tabs for the window, and it is pointless to hide the new tab off to the right.)
* A document that *is* already open, simply selects that tab, without changing the order of existing tabs.
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 everyone,
Today I felt the need to be able to select text between quotes, and
managed to dig up this old message from 2009
(http://lists.macromates.com/textmate/2009-June/028965.html):
On Sun, Jun 7, 2009 at 8:05 PM, Oliver Taylor <olivertaylor at me.com> wrote:
>
> On Sat, Jun 6, 2009 at 7:17 PM, MDX-LE<dj9027 at gmail.com> wrote:
> >
> > How do I Select all the characters between double quotes? When I use Ctrl+Alt+B when the cursor is somewhere inside the double quotes, it selects all the characters inside the quotes AND the quotes themselves.
> >
> > Can I change this so that I can restrict selection within the quotes without the quotes?
>
> If you create a macro or command with the same shortcut you'll override the menu item.
>
> I've attached a macro that might do what you want, but you may have to customize it.
I've attached an improved version of this macro that works for either
single or double quotes, including when single quotes are within a
double quoted string and vice-versa (though it still won't handle
escaped quotes properly).
If you have any suggestions for further improvements let me know!
–Adam
Since I updated to Textmate 2 I have a problem with folding code: whenever I unfold a piece of code (by clicking on the triangle), the code unfolds but the triangle disappears. This way I need to highlight the section and click fold again, instead of just clicking the triangle again to fold it. This was not the case under Textmate 1 and led to me never using Textmate 2 as it's such a crucial functionality for me. I hope you can tell me what I may be doing wrong or resolve it if it's a bug!
Thanks,
Samuel
What happened to the great little feature where you could ask to show/select in the file browser the file you are currently editing? It seems to be missing in action in TextMate 2.
This makes it very difficult (i.e. impossible) to know what file you are editing, especially when lots of tabs are open and there are lots of files in a big hierarchy in the file browser.
Of course if it is there but in some other guise, I'm happy to be corrected! Thx - 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'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!
I'm trying to figure out how to perform a function in textmate2 which was in
textmate1
Used to be able to open a new file "from a template". I no longer see this
option anyway. Any advise much appreciated.
--
View this message in context: http://textmate.1073791.n5.nabble.com/Template-File-New-from-template-tp272…
Sent from the textmate users mailing list archive at Nabble.com.
I've just discovered that part of the breakage in the Asciidoc bundle is due to the higher precedence in TextMate 2 of the indentation rules. In particular, I have deduced that I'm being bolluxed by a rule inherited from text.html. The asciidoc grammar is scoped as text.html.asciidoc, wrongly; I intend to change that, but right now I'm still learning my away around.
(There is little doubt that the scoping of the asciidoc grammar as text.html.asciidoc is a huge mistake and lies at the heart of many of my problems. I didn't write this grammar so it isn't my fault; I'm just trying to fix it so it works. Asciidoc has nothing to do with html - even less, indeed, than markdown does. There are some places where asciidoc should behave like xml, but then the solution is presumably to adopt xml behavior in just those places. So all this is going to change. But humor me anyway, for now.)
According to the FAQ on github, I should be able to shelter myself from indentation rules ("you can disable the auto-indentation entirely") by a setting like this:
{ disableIndentCorrections = :true; }
But no matter how I scope that pref (including no scope, text.html, etc.), automatic indentation when I press Return is happening, under the influence of text.html (the caret is in the scope text.html.asciidoc meta.paragraph.asciidoc).
Have I found a bug in TextMate 2, or am I just being misled by the wording in the FAQ?
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
It turns out that it is wrong, in a grammar, to put a "patterns" section inside a "name/match" section.
But it isn't _forbidden_. It just makes everything behave wrong. I lost an entire day over this, because none of the documentation made this sufficiently clear, but mostly because TextMate did not complain. I am suggesting that it should do so.
Here is an extremely silly example to illustrate. Start with this:
{ patterns = (
{ name = 'punctuation.test';
match = 'this.*?test';
},
);
}
It successfully matches the phrase "this is a test" in the middle of a longer sentence such as "I tell you that this is a test of everything".
Now introduce an embedded pattern:
{ patterns = (
{ name = 'punctuation.test';
match = 'this.*test';
patterns = (
{ name = 'constant.character.escape.untitled';
match = '\\.';
},
);
},
);
}
(I told you it was silly!) The result is that "punctuation.test" now wrongly matches the entire document starting with "this is a test". Evidently, TextMate didn't like that. But what I'm saying is, if TextMate doesn't like that, TextMate should forbid it. The lovely dialog that says that this is not a valid property list, for example, might be used to tell me that this is not a valid grammar and will mess things up as we go along.
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.
Starting with 2.0-alpha.9503 (i guess) it's not possible to disable soft wrap anymore. Or is it just me?
What's the best way to downgrade? For special reasons i need a visible wrap column without the code actually being wrapped.
thanks.
Robert
My bundle command, written in Ruby, looks like this:
s = #... command-line command that produces many lines of output
STDOUT.sync = true
puts '<pre>'
puts `#{s}`
puts '</pre>'
It is set to output as HTML. In TextMate 1, the result was correctly formatted: line after line of text, wrapped in <pre> tags, wrapped in HTML. In TextMate 2, the opening and closing <pre> tags both appear before the output from executing s, and thus the output is not correctly formatted.
Clearly something has changed. What's the new correct way of doing this? 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
Hi everybody !
I use ⌃ ⌘ T to look into the bundles, but what if the key equivalent is used in TM itself ?
**Example:** If I search for ⌘ E in "Select Bundle Item dialog" => I find nothing. Although it is used by TM for menu "Use Selection for Find". So, what would be great would be that the "Select Bundle Item dialog" could inform that the key equivalent is used by TM. Or, when I type in the "Key equivalent" field, a message could inform me that the key equivalent is already used and where.
Furthermore, is there a way to record the settings in the "Select Bundle Item dialog" ? If I previously set «Key equivalent» instead of «Title», I would like to have «Key equivalent» selected the next time I call the dialog. Idem for «Current Scope» and «Actions».
Thank you in advance for your answer.
And thank you for this wonderful tool: TextMate.
Bruno.
Deep in the TextMate bundle is escape.rb, containing this utility:
# URL escape a string but preserve slashes (idea being we have a file system path that we want to use with file://)
def e_url(str)
str.gsub(/([^a-zA-Z0-9\/_.-]+)/n) do
'%' + $1.unpack('H2' * $1.size).join('%').upcase
end
end
The problem is that the "n" modifier on the match requires that this string (str) be ASCII-8BIT encoding. But on the Mac a file system path is UTF-8. Thus it is possible that this method will be sent a UTF-8 string and will choke on it. For example:
e_url("/Users/matt/Desktop/höwdy.txt")
[That's "howdy" with an umlaut over the o, in case it doesn't come across in your email.]
Now, it is legal to make a file:// URL that points to this file. But e_url is failing to create such a URL and we get a warning.
I suggest that this utility may need to be revised for use with Mavericks and Ruby 2.x.
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 am a TextMate 2 Alpha user since the day it was made public. However, some months ago an update of it shredded my TM1 installation because the support folder was then renamed from "Avian" to "TextMate". This was unfortunate but I could live with it since I only relied on TM1 for HTML zen coding anyway.
Once in a while I am trying out new bundles and I am noticing that if I want to install bundles manually I still have to do this in "Application Support/Avian/Pristine Copy/Bundles" since TextMate will ignore everything in "Application Support/TextMate/Bundles" or "Application Support/TextMate/Pristine Copy/Bundles".
Maybe there is a deeper sense to it I just don't get but I find this really confusing and thus hard to work with.
Or maybe I am just getting it wrong and there is a command I need to run or a file I need to delete for this to work properly.
Any help or info regarding this is greatly appreciated.
Thanks,
Torsten