Displaying line breaks

1,567 views
Skip to first unread message

MrAvery

unread,
Jul 15, 2009, 10:11:42 PM7/15/09
to TextWrangler Talk
I understand the difference in line breaks across the Mac, Windows,
and Unix platforms. My question is how do I get TextWrangler to always
display \n as a line break instead of a red ¿? The context that I use
TW in is usually via SFTP to a server. Initially, it converts all \n
to standard line breaks, but if I do a grepped search and replace with
a \n being in the replace string I get the red ¿.

Tom Robinson

unread,
Jul 16, 2009, 4:19:12 PM7/16/09
to textwr...@googlegroups.com

Can you explain why you're manually editing the linebreaks?

TextWrangler has smarts that it works out the linebreaks for a
document when you open it and always respects them after that (when
creating new lines and saving the document).

The current linebreak type is shown at the bottom of the open
document: e.g. 'Unix (LF)'

If you want to change from the current linebreak type to another just
adjust the type in the pop-up menu (per previous paragraph) and save
the document.

Cheers

MrAvery

unread,
Jul 17, 2009, 4:34:40 AM7/17/09
to TextWrangler Talk

> Can you explain why you're manually editing the linebreaks?

I have a single string of data procured from a database. Each
significant piece of data is enclosed in parentheses. I want to set a
line-break after each right (closing) parenthesis for readability. The
command I use in the search-replace window is (with grep turned on)
that I search for this:

\)

but replace it with

\)\n

I'm not clear on your comment below. How should I change my replace
string?

> TextWrangler has smarts that it works out the linebreaks for a  
> document when you open it and always respects them after that (when  
> creating new lines and saving the document).
>
> The current linebreak type is shown at the bottom of the open  
> document:  e.g. 'Unix (LF)'

Thanks!

Tom Robinson

unread,
Jul 18, 2009, 6:30:28 PM7/18/09
to textwr...@googlegroups.com
On 2009-07-17, at 20:34, MrAvery wrote:

> I have a single string of data procured from a database. Each
> significant piece of data is enclosed in parentheses. I want to set a
> line-break after each right (closing) parenthesis for readability. The
> command I use in the search-replace window is (with grep turned on)
> that I search for this:
>
> \)
>
> but replace it with
>
> \)\n
>
> I'm not clear on your comment below. How should I change my replace
> string?

You're doing fine, now you need to tell TextWrangler what linebreaks
to save the document with, using the pop-up menu at the bottom of the
window.

TextWrangler will then translate its internal \n breaks to the ones
specified when you hit save.

Cheers

Reply all
Reply to author
Forward
0 new messages