TextMate's zoom button (the green jewel in the title bar) maximizes windows to the full screen. Great on my 12" PowerBook. Highly annoying on my 24" iMac. I'd rather it maximize vertically only. This behavior seems to vary across OS X applications (Safari only maximizes vertically e.g.). Any chance there is a hidden preference?
Thanks,
j.
Jay Soffian wrote:
TextMate's zoom button (the green jewel in the title bar) maximizes windows to the full screen. Great on my 12" PowerBook. Highly annoying on my 24" iMac. I'd rather it maximize vertically only. This behavior seems to vary across OS X applications (Safari only maximizes vertically e.g.). Any chance there is a hidden preference?
I'm not positive, but I think you're just out of luck on this one. It's a bummer, but you'll have to either drag with the mouse, or make an applescript to set the window bounds.
-Jacob
On Nov 16, 2006, at 6:25 PM, Jacob Rus wrote:
I'm not positive, but I think you're just out of luck on this one. It's a bummer, but you'll have to either drag with the mouse, or make an applescript to set the window bounds.
Oooh, that's a good idea. I didn't realize Applescript had that control over windows. A little googling and:
http://www.bigbold.com/snippets/posts/show/1067
I'll make a few options for various window sizes I use commonly and just toss them into my personal bundle.
Thanks for the pointer. BTW, I just noticed that iTerm has a preference for "Maximizes vertically only" ... a similar preference might be a nice TextMate addition. Surely Allan can just point to the code and say "make it so." That reminds me, the TextMate bundle seems to be missing the meta-X do-what-I-want command. :-)
j.
On 11/16/06, Jay Soffian jay-txmt@soffian.org wrote:
On Nov 16, 2006, at 6:25 PM, Jacob Rus wrote:
Thanks for the pointer. BTW, I just noticed that iTerm has a preference for "Maximizes vertically only" ... a similar preference might be a nice TextMate addition. Surely Allan can just point to the code and say "make it so." That reminds me, the TextMate bundle seems to be missing the meta-X do-what-I-want command. :-)
In my ideal world, Textmate would expand horizontally only as wide as the longest line of text when you clicked the zoom button.Though I can see how vertical only may also be useful, especially when writing text (e.g. LaTeX) instead of code.
cheers, -don
On Nov 16, 2006, at 11:46 PM, Don Kalar wrote:
In my ideal world, Textmate would expand horizontally only as wide as the longest line of text when you clicked the zoom button.
You could do something like this as bundle command:
#!/bin/sh chars=`perl -ne '$m = length if length > $m; END{print $m}'` cat <<__EOF__ | osascript set fontscale to 6.25 set gutter to 54 set scrollbar to 16 set maxwidth to 1920 tell application "TextMate" set d to bounds of window 1 set l to item 1 of d set t to item 2 of d set r to l + (fontscale * $chars) + gutter + scrollbar if r > maxwidth then set r to maxwidth set b to item 4 of d set bounds of window 1 to {l, t, r, b} end tell __EOF__
Input: Document / Output: Discard.
It's not perfect but gets pretty close in the testing I just did. You'll have to figure out your own fontscale. To get close download FreeRuler [1]. Set your wrap column to 100 and make your right margin indicator visible in the TextMate prefs then just measure with FreeRuler and divide the pixel count by 100. Obviously adjust gutter and maxwidth as appropriate.
Though I can see how vertical only may also be useful, especially when writing text (e.g. LaTeX) instead of code.
Well I primarily use TextMate for Python and prefer lines no wider than 78 chars. In fact, people who code lines wider than that should be shot -- at least until TextMate's wrapping is improved. :-)
That reminds me of another nit ... when scrolling horizontally I'd much prefer if the gutter did not scroll out of the window frame.
j.
On Nov 16, 2006, at 6:38 PM, Jay Soffian wrote:
Oooh, that's a good idea. I didn't realize Applescript had that control over windows. A little googling and:
http://www.bigbold.com/snippets/posts/show/1067
I'll make a few options for various window sizes I use commonly and just toss them into my personal bundle.
This seems to work as a vertical maximize for me. Preserves the horizontal position and size, maximizes only vertically:
#!/bin/sh
/usr/bin/osascript -e ' set screenHeight to word 3 of (do shell script "defaults read / Library/Preferences/com.apple.windowserver | grep -w Height") as number
tell application "TextMate" set theBounds to bounds of front window set xPosition to item 1 of theBounds set windowWidth to item 3 of theBounds set bounds of front window to {xPosition, 0, windowWidth, screenHeight} end tell '
I bound it to ctrl-cmd-Z.
For those too lazy to type in that script, click below:
:)
On Nov 16, 2006, at 11:39 PM, Dan Lowe wrote:
On Nov 16, 2006, at 6:38 PM, Jay Soffian wrote:
Oooh, that's a good idea. I didn't realize Applescript had that control over windows. A little googling and:
http://www.bigbold.com/snippets/posts/show/1067
I'll make a few options for various window sizes I use commonly and just toss them into my personal bundle.
This seems to work as a vertical maximize for me. Preserves the horizontal position and size, maximizes only vertically:
#!/bin/sh
/usr/bin/osascript -e ' set screenHeight to word 3 of (do shell script "defaults read /Library/Preferences/com.apple.windowserver | grep -w Height") as number
tell application "TextMate" set theBounds to bounds of front window set xPosition to item 1 of theBounds set windowWidth to item 3 of theBounds set bounds of front window to {xPosition, 0, windowWidth, screenHeight} end tell '
I bound it to ctrl-cmd-Z.
-- The best way to predict the future is to invent it. -Alan Kay
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
On Nov 17, 2006, at 6:16 PM, Ben Soprano Alpert wrote:
For those too lazy to type in that script, click below:
I keep forgetting how simple it is to attach commands. :-)
Here's mine which does the horizontal resize to the widest code line in the current file. Adjust fontscale and maxwidth for your screen.
j.
On Nov 16, 2006, at 5:57 PM, Jay Soffian wrote:
TextMate's zoom button (the green jewel in the title bar) maximizes windows to the full screen. Great on my 12" PowerBook. Highly annoying on my 24" iMac. I'd rather it maximize vertically only. This behavior seems to vary across OS X applications (Safari only maximizes vertically e.g.). Any chance there is a hidden preference?
That's not how Safari works, actually. The standard behavior in most Mac apps is to maximize to "as big as needed to show the window contents". So Safari will expand horizontally to the width of the page (if there is one) and the height of the page (which on most pages is probably longer than your screen can show, so it goes as tall as it can). If you go to a page and make Safari nice and skinny and click the zoom control, it will probably increase its horizontal size (but not to the entire screen width) as well as its vertical size. YMMV depending where you visit to test this... but that's how it works on my site.
-dan
On 11/16/06, Dan Lowe dan@tangledhelix.com wrote:
That's not how Safari works, actually. The standard behavior in most Mac apps is to maximize to "as big as needed to show the window contents". So Safari will expand horizontally to the width of the page (if there is one) and the height of the page (which on most pages is probably longer than your screen can show, so it goes as tall as it can). If you go to a page and make Safari nice and skinny and click the zoom control, it will probably increase its horizontal size (but not to the entire screen width) as well as its vertical size. YMMV depending where you visit to test this... but that's how it works on my site.
Which is why I suggested that the horizontal window size zoom to the longest line, though now that I think about it more, that preference would interact with having soft wrap enabled. When writing code I turn off soft wrapping, so in that case the horizontal expansion would be ideal (sadly there are times when you inherit code that doesn't conform to a reasonable 78 character/line limit), but when writing prose in latex, markdown, etc., then I have soft wrap enabled, and would want only the vertical expansion on zoom.
That being said, I'm still more interested in 2.0 moving forward than I am with the nuanced behavior of gumdrops.
cheers, -don