> Date: Mon, 10 Sep 2012 07:08:15 +1000
> From: David Howden <dhowden(a)gmail.com>
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: [TxMt] Re: Java Compile and run
> Message-ID:
> <CAP2kWKHah0sAKbNzh9GFwb6q-YfzJ=dqrSUDHgxrLoe9rvjqvg(a)mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
>
> Right, so I've had a little play with this.
>
> 1. Create a file called helloworld.java and save it on your desktop.
> 2. Put this in it:
> public class helloworld {
> public static void main(String[] args) {
> System.out.println("Hello World!");
> }
> }
> 3. Save again!
> 4. Cmd+R
>
> This runs perfectly for me in TM2 using the default Java bundle. Try
> it on your version (checking and double checking the filename and the
> class name match exactly).
>
> Cheers,
>
> David
Hey David,
I am pleasantly surprised, but your suggestion was what I needed! Apparently, the code I had used (below) didn't have the class defined as public. I don't understand why that would make a difference, but hey, it works, and that's what really matters.
Many thanks!
Michael
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); //Display the string.
}
}
> [?] compile and run java code [?] cannot find the class file [?]
Do you have multiple sources?
The Compile & Run was initially done for just running a single Java file.
That said, the command does have some poor man?s build system support by allowing you e.g. to set TM_JAVA_FILEGLOB (presumably to ?*.java?) which would call the compiler with all the matches (rather than just the current one).
The alternative would be to set CLASSPATH if you have your class files somewhere. The proper solution though is to use a build system (when you?re doing more than just a quick test).
No, it is only a single file. My wife is taking a beginner class in Java programming, and I am trying to set up a simple environment on our Mac in which she can do her homework. As she is using only very simple single files, and I want her to concentrate on the code and not the programming environment, I would like to enable her to simply press Command-R to compile and run the code. However, it appears that the system is not automatically creating the needed .class file, as shown in the complete output here:
Exception in thread "main" java.lang.NoClassDefFoundError: helloworld
Caused by: java.lang.ClassNotFoundException: helloworld
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Given all this, what is the best way to configure this poor man's compile-and-run environment?
I have installed the latest iteration of Netbeans IDE, but it is way too much for my wife, at least for the moment.
I have Max OS X 10.8.1 and am using TM 2.0 (9302), and am having trouble getting it to compile and run java code from within TM. It cannot find the class file, as shown here:
Exception in thread "main" java.lang.NoClassDefFoundError: helloworld
Caused by: java.lang.ClassNotFoundException: helloworld
My guess is that a needed environment variable is not set, but I cannot find any documentation on what to set. Any ideas?
I've noticed, in all of the beta versions of TM2 I've tested yet, that
the arrow button to expand the text fields for multiple lines doesn't
work. (See here: http://bit.ly/P3RASq)
Is there a plan to fix this?
Cheers!
--
Nicolas Vaughan
Allan,
thought you might be interested to know: if I set the "Save:" popup to "Nothing" in the bundle editor I no longer see the broken syntax colouring after running my uncrustify command, so it seems to have something to do with saving immediately before. I notice that similar reformatting commands, such as the XML Tidy command also save nothing, and they also work, but they too break if you set "Save:" to "Current Document".
Chris
I just switched from TextMate 1 to TextMate 2. In TextMate 1, it was
possible to have .c and .h files in different folders and when I would use
the command go to file counterpart (⌥⌘↑) it would open the counterpart. In
TextMate 2, it will only open the counterpart if they are in the same
folder. Is there something I'm doing wrong?
Thanks, -- dv
--
View this message in context: http://textmate.1073791.n5.nabble.com/Open-Counterpart-tp25611.html
Sent from the textmate users mailing list archive at Nabble.com.
A recent problem cropped up in my use of the LaTeX bundle recently. Since r9295, I get the message I paste below when I try to insert a Ref-TeX Style citation in my document. This is on a mid-2007 macmini with OS 10.7.4. On my other machine, a recent macbook with OS 10.8.1, I've been updating TextMate regularly, right to r9300, and don't have any problem. My TextMate setup is the same on both machines (or so I think). How can I fix this? Any pointer appreciated,
--Gildas
Message:
Failure running “Citation (Ref-TeX Style)”.
sh: : command not found
/Users/gweltaz/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/ui.rb:182:in `load': Cannot parse a NULL or zero-length data (OSX::PropertyListError)
from /Users/gweltaz/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/ui.rb:182:in `menu'
from /Users/gweltaz/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/ui.rb:177:in `popen'
from /Users/gweltaz/Library/Application Support/TextMate/Managed/Bundles/Bundle Support.tmbundle/Support/shared/lib/ui.rb:177:in `menu'
from Citation (Ref-TeX Style):18
From the TM2 release notes:
2012-08-31
- Improved alignment of the gutter images and made them adjust to font size. Dennis Vennink
While I appreciate the new customization options here (have already added the gutter styling options to my own, personal theme), the new sizing results in tiny icons for me (using 12pt Inconsolata font). Does anyone else see this too, or is this just me? And, if so, is there any possibility of adding an icon size factor to the cornucopia of gutter styling options?
Thanks,
-- Phil
Hey guys, I'm trying to write a grammar file for a MATLAB-like language,
and I'm having trouble with the transpose operator. The transpose operator,
represented by the single quote, can be used in a variety of different
situations:
# Transposing a variable:
myMatrix'
# Transposing the result of a function:
myFunc( myMatrix )'
# Transposing the result of a parenthetical:
(myMatrix - 1)'
# Transposing a matrix literal:
[1,2,3]'
The first two forms are not difficult, they can be matched with simple
"match" forms. However, the parenthetical and matrix literal forms are
more difficult; using begin/end blocks in the pattern matching causes *every
*open parentheses or open square bracket to match, regardless of whether or
not there is a transpose operator matched with the closing parentheses or
square bracket. Not only does this cause performance issues, this causes
issues with nested operators such as:
([1,2,3]' - [4,5,6]')
Any ideas on how to do this the proper way? I don't really care about
matching the parentheses or the square brackets; I just care that they are
present. Positive look-behind assertions would work fabulously here, but
they can't be variable-length, so that's a no-go here.
Thanks!
-E
Hi,
I am trying to run python (the enthought python distribution version) via cmd-R in TM2.
I set under Preferences - Variables "TM_PYTHON" to /Library/Frameworks/EPD64.framework/Versions/7.3/bin
I have no shebang line at the beginning of the script.
When I hit cmd-R, it results in
Program exited with code #1 after 0.00 seconds.
What is wrong with this approach?
Additionally, also under Preferences - Variables "PYTHONPATH" to point into the paths where I want it to be - is this the right way?
Thanks for your help,
Cheers,
Claus
Any users of CTags might find this useful. It uses the history file as a stack of places to return to. Create a new command in the CTags bundle.
Name Go Back
Scope Selector source
Key equivalent ^[
Save nothing
Input nothing
Output discard
#!/usr/bin/env ruby -wKU
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate.rb'
history = ENV['TmCtagsHistoryFileName'] || 'tmtagsHistory'
lines = IO.readlines(history)
if lines.shift =~/=file:(.*?)&line=(\d+)/
File.open(history, 'w') {|f| f.puts lines}
TextMate.go_to :file => $1, :line => $2.to_i
end
Dave.
I have done this loads of times in TM1, but I am failing to change the invocation key for looking up a word in ctags. The default is cmd click but I wan to set ctrl ] so I don't have to use the mouse. Should be simple - just edit the key equivalent in the bundle editor and the job is done. Unfortunately when I do this it makes no difference.
Dave.
I don't know whether it's intended behaviour, but I find it counter-intuitive:
When the file browser has the focus, starting a Find (Cmd-F) with search scope 'Document' or 'Selection' does not initiate a search (or give a warning).
The expected behaviour is to search in the currently open file (or, if one wants to be fancy, search in the files selected in file browser).
And another anomaly I have just spotted testing this:
Having one file open and some text selected and the focus on the editor, opening the Find window with Cmd-F , the Find window opens as expected with 'Selection' as scope. However, actually performing the search finds the needle in a different file within the same project; it'll even open it if it's closed.
Strange.
Jonas
Hi Allan & everyone,
I just made an effort to work with TM2 over the past few days, and love many aspects of TM2, but I am just not happy with the design and functionality of the File Browser in TM2.
So could someone please clue me (us) in about the plans for the TM2 file browser.
1) Is it / Will it be possible for users to change the background colour of the file browser?
I'm using "Pastels on Dark" theme, and the file browser pane is a bright distraction for the eyes.
2) Why have some of the core functionality of the file browser (project drawer) changed so much between TM1.5 and TM2?
a) Why do we need to double-click on the file name to open the file, but can single-click on the tiny icon?
b) Is this by design or a temporary bug that will be fixed some day?
c) Why have the "Create New File" functionality been removed from TM2?
d) Is this by design or another temporary issue that will be fixed some day?
e) Also, why does TM2 not remember the previously saved file name and format like TM1.5 does?
I love the SCM integration in the file browser, but other than that the TM1.5 file browser was much better!
By the way, I really like the newly designed "update window change log" I just saw after updating TM2 this morning.
Kind regards,
Matz
Dear all,
Another question regarding the subversion bundle:
I understand the scope of the operation is selected by marking the file or folder in the file browser pane. In TM1 the parent folder had its own item at the very top, so it could be selected instead of a subfolder or file. Now, if my list of files is shorter than the space in the file browser pane, I can click in the empty space to get the parent folder as scope. However, I haven't found how to do this if my list of files/subfolders fills the entire pane.
And here are some other things; sorry if they've been covered before, but I didn't see them mentioned:
Is it possible to detach the results view from the window? For both tasks I use (LaTeX type setting and SVN) having this view attached to the main project window wastes a lot of space, as the information is concentrated in the left third or so of the window. Vertical extent of that window is more important.
So can I get the old detached windows back?
Can bundles in file browser get a triangle so they can be unfolded? Having to do the right-click, 'show package content' thing is a bit cumbersome (especially since you then dive into the hierarchy).
Find window: can the result view for 'find all' get horizontal scrolling and and option for line wraps? Right now I cannot see the results of my search for long lines.
Thanks,
Jonas
PS: I'm very, very happy to see the frequent updates. I'm prepared to pay (again) for TM2 once it becomes stable.
Allan,
No, that doesn't fix it, the text stays white even after switching tabs, or scrolling or even selecting a block of text (including the non-coloured text).
I have just noticed that the colour the text goes to depends on what code the most recent edit took place on, so if it were:
object.aproperty = @"foo"
then the text takes on the colour of "aproperty", which in my case is blue (Twilight theme), this time the code lost its syntax colour up to the line that got reformatted but not beyond, whereas if I do this in a block of @synthesize statements at the top of the file the text goes white from the edit onwards, but not before.
Chris
On 3 Sep 2012, at 11:44, textmate-request(a)lists.macromates.com wrote:
> OK, so it might be a refresh problem (rather than a parse problem).
>
> Next time it happens, try switch to another tab and back, to see if that fixes the problem (and let me know the result).
Hi,
Take a code snippet like this:
1:
2: if true
3: puts "Hello, world"
4: end
5:
6: puts "Bye"
7:
If I triple-click on line 2, then drag my selection down, I'm unable to make the selection 2-5. I get to 2-4, then as I drag downwards the selection jumps to 2-6.
The converse is not a problem, I can triple-click line 4, then drag upwards and make a selection of 4-1.
Initially I had gotten the idea that this was a regression since TM1, but I've just tested it and it isn't so.
Is there a reason that I can't select that blank line? Currently if I find myself in a position where I need to, I place the caret in line 5, hit Shift-Cmd-L, and up arrow until I have the selection I want.
Adam
On Sat, 01 Sep 2012 12:00:07 +0000,
textmate-request(a)lists.macromates.com wrote:
> Send textmate mailing list submissions to
> textmate(a)lists.macromates.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.macromates.com/listinfo/textmate
> or, via email, send a message with subject or body 'help' to
> textmate-request(a)lists.macromates.com
>
> You can reach the person managing the list at
> textmate-owner(a)lists.macromates.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of textmate digest..."
>
>
> Today's Topics:
>
> 1. Re: TM2 support HTML win -> Javascript -> AppleScript ->
> Insert chars (Timothy Bates)
> 2. Re: TM2 support HTML win -> Javascript -> AppleScript ->
> Insert chars (Hans-J?rg Bibiko)
> 3. Tab bar colours (Dave Baldwin)
> 4. Re: Tab bar colours (Hans-J?rg Bibiko)
> 5. Re: Tab bar colours (Timothy Bates)
> 6. Find in Project... (Mikael Hultgren)
> 7. Php code coloring is not working with TextMate
> (textmatenightmare)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 31 Aug 2012 14:10:27 +0100
> From: Timothy Bates <timothy.c.bates(a)gmail.com>
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: [TxMt] Re: TM2 support HTML win -> Javascript -> AppleScript
> -> Insert chars
> Message-ID: <B5DACD7B-6A9F-4F2E-AAFD-0C2144596141(a)gmail.com>
> Content-Type: text/plain; charset=windows-1252
>
> insert doesn?t seem to be in the script dictionary for tm2...
>
> t
> On 31 Aug 2012, at 12:39 PM, Hans-J?rg Bibiko <bibiko(a)eva.mpg.de> wrote:
>
>> Hi,
>>
>> I'm just reviewing some of my bundles and came across with this issue:
>>
>> I have several commands which display as HTML output window some
>> characters and the user can insert a given character by clicking on
>> it. The mechanism is done via the Javascript-system bridge to an
>> AppleScript which should insert the character.
>>
>> For TM2 it doesn't work. Thus my question is:
>> Is this
>> - not supported by AppleScript,
>> - not yet implemented in TM2,
>> - broken,
>> - or is there an other more elegant way to achieve the insertion of
>> a string from the HTML window to TM2?
>>
>> I'm using TM2 (9293) on 10.7.4
>>
>>
>> Hmm, it seems that this:
>> echo -en 'tell app "TextMate" to insert ?data utf8e1b894? as Unicode
>> text'| osascript --
>>
>> is not possible under Lion.
>>
>>
>> Any hints/ideas?
>>
>> Cheers,
>> --Hans
>>
>>
>> _______________________________________________
>> textmate mailing list
>> textmate(a)lists.macromates.com
>> http://lists.macromates.com/listinfo/textmate
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 31 Aug 2012 15:22:00 +0200
> From: Hans-J?rg Bibiko <bibiko(a)eva.mpg.de>
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: [TxMt] Re: TM2 support HTML win -> Javascript -> AppleScript
> -> Insert chars
> Message-ID: <BB9059AD-82F0-4C0E-B75B-79E473296A20(a)eva.mpg.de>
> Content-Type: text/plain; charset=windows-1252
>
>
> On Aug 31, 2012, at 3:10 PM, Timothy Bates wrote:
>
>> insert doesn?t seem to be in the script dictionary for tm2...
>
> ... oops, yes, you're right. Just looked inside TM1 script dict and
> there I found it ;)
>
> ok, then I'll be patient ;)
>
> Thanks,
>
> --Hans
>
> ------------------------------
>
> Message: 3
> Date: Fri, 31 Aug 2012 14:28:49 +0100
> From: Dave Baldwin <dave.baldwin(a)3dlabs.com>
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: [TxMt] Tab bar colours
> Message-ID: <7A841ED5-C364-4546-8292-19739938758C(a)3dlabs.com>
> Content-Type: text/plain; charset=us-ascii
>
> Is there any way to change the colour of the text and/or background
> in the tabs as the dark grey text on slightly less dark grey
> background makes it hard to read the text. Ironically when Textmate2
> is in the background it is easier to read the tab titles than when
> Textmate is in the foreground and being used!
>
> Thanks,
>
> Dave.
>
> ------------------------------
>
> Message: 4
> Date: Fri, 31 Aug 2012 15:32:33 +0200
> From: Hans-J?rg Bibiko <bibiko(a)eva.mpg.de>
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: [TxMt] Re: Tab bar colours
> Message-ID: <21DC91C2-7136-40B0-844B-169E743249BC(a)eva.mpg.de>
> Content-Type: text/plain; charset=us-ascii
>
>
> On Aug 31, 2012, at 3:28 PM, Dave Baldwin wrote:
>
>> Is there any way to change the colour of the text and/or background
>> in the tabs as the dark grey text on slightly less dark grey
>> background makes it hard to read the text. Ironically when
>> Textmate2 is in the background it is easier to read the tab titles
>> than when Textmate is in the foreground and being used!
>
> +1
>
> Best,
> --Hans
>
>
>
>
>
>
>
>
> ------------------------------
>
> Message: 5
> Date: Fri, 31 Aug 2012 14:47:17 +0100
> From: Timothy Bates <timothy.c.bates(a)gmail.com>
> To: TextMate users <textmate(a)lists.macromates.com>
> Subject: [TxMt] Re: Tab bar colours
> Message-ID: <4915CE26-4DFA-4708-A5C4-C5BED63DB9BF(a)gmail.com>
> Content-Type: text/plain; charset="windows-1252"
>
> I kind of wonder I think the theme background, text, and selection
> colors could flow through the whole interface.
>
> Not having seen it, it?s hard to know. But I set my gutter to
> background, and I liked it.
>
> Letting that flow across into the file browser, and up into the tab
> bar (selected tab = line highlight, other tabs = background, text in
> tabs = gutter line text or default text color) would create a single
> set of desired contrasts and meanings for colour on the screen.
>
> bg-colored tab bar would play nicer with distraction free full screen also.
>
> my 2?
> t
>
> On 31 Aug 2012, at 2:32 PM, Hans-J?rg Bibiko <bibiko(a)eva.mpg.de> wrote:
>> On Aug 31, 2012, at 3:28 PM, Dave Baldwin wrote:
>>> Is there any way to change the colour of the text and/or background
>>> in the tabs as the dark grey text on slightly less dark grey
>>> background makes it hard to read the text.
>> +1
>> Best,
>> --Hans
>
Alan,
here is the command in question (I've also attached a screenshot of the command setup in the bundle editor):
#!/usr/bin/env bash
[[ -f "${TM_SUPPORT_PATH}/lib/bash_init.sh" ]] && . "${TM_SUPPORT_PATH}/lib/bash_init.sh"
"/usr/local/bin/uncrustify" -l OC -c "$TM_UNCRUSTIFY_OBJC_CONFIG";
There doesn't seem to be any special pattern, it doesn't always do it and immediately running the command again seems to restore the syntax colouring. Making any further edit to the file also restores the syntax colouring.
I mostly work on Objective-C files, a simple test case would be:
1. open a largish ObjC .m file (say 500+ lines).
2. make an edit, e.g.: unindent a line of code
3. run the command
4. try this a few times
Often I see the code lose its syntax colouring from the point where I made the last edit onwards, sometimes its only the actual line or lines in question. All the affected text goes white, it's as though it has lost its scope although selecting some text in the unhighlighted area and showing the scope reveals a perfectly normal scope list.
I have seen this behaviour on 3 separate Macs: 2 Mac Pro's and 1 MacBook Pro, running pretty much all of the alphas so far, on Lion 10.7.4.
Hope that helps
Chris
On 2 Sep 2012, at 01:16, textmate-request(a)lists.macromates.com wrote:
> This should not be able to happen.
>
> Can you send step-by-step about how to reproduce (that is, where to get this command from and how you get it into this unhighlighted state).
> On 2 Sep 2012, at 16:25, Allan Odgaard wrote:
>
> > On Sep 2, 2012, at 5:09 PM, Jonas Zimmermann <listen at jonaszimmermann.de> wrote:
> >
> >> OK, I've been using ⇧⌘Y for a while. This doesn't show added folders (for SVN) as uncommitted, however. So commits depending on those folders (such as added files within) fail.
> >
> > That sounds like something that could easily be fixed if you provide steps-to-reproduce.
Thanks for including the steps as I was able to reproduce this.
> ...
>
> So added folders should be shown as uncommitted changes; don't know whether there should also be a check for dependencies when trying to commit (probably not).
I talked to Allan this morning and I am in agreement with you. I've
suggested why to Allan in IRC but for posterity, I'll post here as
well. Basically, Subversion treats folders as versionable objects.
They can be added/modified/deleted to the repository with/without
files in them and they even have their own versioned properties like
files do. That being said, I think it makes sense to have a folder in
the "Uncommitted Changes" view whenever the folder has changes on
itself or below it. While Allan and I talk about this in IRC, there
are a few workarounds:
* When committing from the "SCM Status" view, make sure there are no
files selected when you show SCM command (⌘Y) (Note: When you have no
files selected and initiate a commit, TextMate will show you all
changes in the working copy)
* Commit from the file browser and select the path(s) you want to
commit including the newly added folder (Note: When selecting a folder
and initiating a commit, it will of course include paths for all
descendants)
Using those two options above, I was able to work around this
situation. The reason you're only seeing the file in the commit
dialog is because in your step #6 (6. Select new file there, ⌘Y,
Commit), you selected the file prior to initiating the commit thus
telling TextMate that you wanted to commit that file alone.
I hope this helps explain why this is happening and gives you a
workaround until Allan and I can come up with something suitable.
--
Take care,
Jeremy Whitlock (@whitlockjc on Twitter)
http://www.thoughtspark.org
Hi All,
TM2s HTML output window is somewhat limited compared to TM1:
- it uses sort of *tabs*, so I can't have multiple windows next to each other (handy to remove clutter and usually welcome, but when I run multiple apps/scripts in parallel I need separate windows to monitor them)
- it only allows one 'long running' process at a time
Since my projects often include multiple apps and/or scripts that interdepend and I need to run them side by side (eg client server etc). I used to use HTML output windows, so that I could have specially formatted log messages be clickable and get me to the correct location in the source code etc.
So I wrote an application that provides multiple HTML output windows and remembers their individual placement and size. It is called ApLo, and available as source here:
https://github.com/gknops/ApLo
and wrapped into a TextMate bundle here:
https://github.com/gknops/aplo.tmbundle
For starters I wrote an Xcode4 bundle that goes with it:
https://github.com/gknops/xcode4.tmbundle
As time permits I plan to add support for iOS projects as well, and STDOUT/STDERR parsers for other languages (perl, lua) as I come across them.
Maybe these bundles will be useful for others as well.
Gerd
Hi,
I regularly run the uncrustify command to tidy up my ObjC source, often when I do this the syntax colouring in the current file becomes broken until I make an edit (like a new line return), does anyone know a way to force a refresh of the syntax colouring after a command that replaces the entire document?
Chris
Just an idea, maybe it's like this for a good reason, but it's always bugged me that the "Go To" windows just float around. I can see a few reasons why it's awkward (at least for me):
• if you're using multiple displays the "Go To" windows can end up opening on a different display than the actual textmate window you're calling it from, this seems to be inconsistent amongst them though
• if you have multiple projects open, the "Go To" position is shared, so if you move it over to the current textmate project window that you're working with and then switch to the other project, the "Go To" window will be in its last location
• in general it feels like it brings you out of the interface the way they are implemented now
Not like there are "bugs" or real problems with it, but i do feel like interface wise, it's a little clumsy. Thoughts?