SoftWrap in worksheets

36 views
Skip to first unread message

LuKreme

unread,
Mar 22, 2013, 2:27:00 PM3/22/13
to Bbedit List
I have soft text wrap enabled for my text files, but I would like to have it DISABLED in worksheets where I find it extremely annoying. However, as far as I can tell, soft-wrap is a global on/off that applies to every document of every type.

I'm probably missing something, right? Right?

--
if you ever get that chimp off your back, if you ever find the thing
you lack, ah but you know you're only having a laugh. Oh, oh here we
go again -- until the end.

Bruce Van Allen

unread,
Mar 22, 2013, 3:17:45 PM3/22/13
to bbe...@googlegroups.com
On 2013-03-22 at 11:27 AM, kre...@kreme.com (LuKreme) wrote:

>I have soft text wrap enabled for my text files, but I would like to
>have it DISABLED in worksheets where I find it extremely annoying.
>However, as far as I can tell, soft-wrap is a global on/off that
>applies to every document of every type.

You can turn soft wrap on or off for individual files with menu
commands or by clicking the "T" in the upper left of the window
and choosing options. Once the file is saved, that setting will
stick regardless of the general preferences setting.

There might also be an "expert preference" for setting text wrap
with worksheets in general, but I don't know it...

HTH


Best Regards,

- Bruce

_bruce__van_allen__santa_cruz_ca_

Christopher Stone

unread,
Mar 22, 2013, 10:57:04 PM3/22/13
to bbe...@googlegroups.com
On Mar 22, 2013, at 13:27, LuKreme <kre...@kreme.com> wrote:
I have soft text wrap enabled for my text files, but I would like to have it DISABLED in worksheets where I find it extremely annoying. However, as far as I can tell, soft-wrap is a global on/off that applies to every document of every type.
______________________________________________________________________

I have Cmd-Shift-R bound to Soft-Wrap, so it's easy to toggle.

I actually have it turned off globally, because it's easier for me to notice it's off than on and toggle it at need.

But I have a script that makes new shell documents bound to Ctrl-W (for worksheet).  You can set attributes you you're heart's content in this way:

-------------------------------------------------------------------------------------------

tell application "BBEdit"
  set newShellDoc to make new shell document
  tell newShellDoc's window
    set bounds to {0, 44, 1920, 1196}
    set soft wrap text to false
  end tell
end tell

-------------------------------------------------------------------------------------------

--
Best Regards,
Chris

Tom Robinson

unread,
Mar 22, 2013, 11:10:48 PM3/22/13
to bbe...@googlegroups.com
You can also have soft wrap, and other options, per file type:

Preferences > Languages > right click desired language (may need to define it first) > select Edit.

Cheers

LuKreme

unread,
Mar 24, 2013, 11:20:19 AM3/24/13
to bbe...@googlegroups.com
In our previous episode (Friday, 22-Mar-2013), Bruce Van Allen said:
> On 2013-03-22 at 11:27 AM, kre...@kreme.com (LuKreme) wrote:
>
>> I have soft text wrap enabled for my text files, but I would like to
>> have it DISABLED in worksheets where I find it extremely annoying.
>> However, as far as I can tell, soft-wrap is a global on/off that
>> applies to every document of every type.
>
> You can turn soft wrap on or off for individual files with menu commands or by clicking the "T" in the upper left of the window and choosing options. Once the file is saved, that setting will stick regardless of the general preferences setting.

Right. But I am not saving worksheets, I am creating new ones for a specific task and the soft wrap always defaults to on.

I always want it on in regular text files, but I never want it on in shell worksheets. (Why anyone would want it on in a shell worksheet is beyond me, honestly).

In our previous episode (Friday, 22-Mar-2013), Tom Robinson said:
> You can also have soft wrap, and other options, per file type:
>
> Preferences > Languages > right click desired language (may need to define it first) > select Edit.

That works great for text files, but sadly does nothing for worksheets.

In our previous episode (Friday, 22-Mar-2013), Christopher Stone said:
> But I have a script that makes new shell documents bound to Ctrl-W (for worksheet). You can set attributes you you're heart's content in this way:
>
> tell application "BBEdit"
> set newShellDoc to make new shell document
> tell newShellDoc's window
> set bounds to {0, 44, 1920, 1196}
> set soft wrap text to false
> end tell
> end tell

This looks like it's the way to go. Do you happen tp know how to place the new window on screen 2 instead of at the top left of screen 1?

--
You too will get old. And when you do you'll fantasize that when you
were young prices where reasonable, politicians were noble, and children
respected their elders. Respect your elders.

Christopher Stone

unread,
Mar 24, 2013, 12:45:38 PM3/24/13
to bbe...@googlegroups.com
On Mar 24, 2013, at 10:20, LuKreme <kre...@kreme.com> wrote:
But I have a script that makes new shell documents bound to Ctrl-W (for worksheet).  You can set attributes you you're heart's content in this way: ... 

This looks like it's the way to go. Do you happen tp know how to place the new window on screen 2 instead of at the top left of screen 1?
______________________________________________________________________

Sure.

Applescript considers multi-screen layouts as one big screen space, so the bounds of my desktop space with one screen is:

{0, 0, 1920, 1200}

If I had two such monitors it would look like:

{0, 0, 3840, 1200}

(If memory serves.)

So the simple way is to put your BBEdit worksheet where you want it, resize it the way you want, and run my get bounds (of the front window) script on it.  Then change the bounds values in the new worksheet script to your preference.

(It occurs to me that you might be able to dispense with bounds by saving the default worksheet (in the window menu) while correctly positioned on screen 2, but I don't have two screens right now to test.)

If you want to get fancy you can download a little Unix executable called cscreen.  It will let you get screen size information on a multi-monitor setup quite painlessly:

On my MacBook Pro:

DisplayID  Index     Depth     Width     Height  Refresh
 42733c0       1        32      1920       1200     0

With that info you can use a calculation to place your window on monitor 2 no matter what changes take place on the system.  E.g. if you change out monitors to ones with different resolutions.

set scrnRes to do shell script "/usr/local/bin/cscreen | awk '/^ *[0-9]+/ {print $4}'"

You have to deal with the menu bar or lack thereof when doing calculations.

--
Best Regards,
Chris

LuKreme

unread,
Mar 24, 2013, 1:20:54 PM3/24/13
to bbe...@googlegroups.com
In our previous episode (Sunday, 24-Mar-2013), Christopher Stone said:
> (It occurs to me that you might be able to dispense with bounds by saving the default worksheet (in the window menu) while correctly positioned on screen 2, but I don't have two screens right now to test.)

Doh! Yes, of course that works.

--
Hey, baby, I've got just the cure for that penis envy back at my
apartment...

Reply all
Reply to author
Forward
0 new messages