[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-nano] Soft-Wrap and Show-Codes?

From: David Lawrence Ramsey
Subject: Re: [Help-nano] Soft-Wrap and Show-Codes?
Date: Fri, 06 Oct 2006 12:36:20 -0400
User-agent: Thunderbird (X11/20060909)

Dan Mahoney, System Admin wrote:


> Damn.  The real problem is that there's no real way to differentiate
> between a "wrap" carriage return and a hard-return (otherwise I could
> just strip after the fact with a script).

And there's really no way to do it visually with a lot of soft-wrapping
editors I've tried.  Although, with nano, I suppose that whitespace
display mode could be extended to display hard carriage returns as well
as tabs and spaces differently.

> Having a user-definable hard-return key could be fairly easy.  For
> example, having nano insert <BR>\n (literally) when I hit return in
> HTML files.

That sounds like something that'll have to wait until nano gets
rebindable keys, assuming that there's also a way to add new
functionality to the rebound keys.

> (This actually all comes from dealing with blogging and fighting the
> blog system's auto-format engine, which formats ALL \n to <br>...which
> means my blogs get wrapped to the width of my ssh screen, or wrapped
> to long-short-long-short).  I have the option to turn it COMPLETELY
> OFF...but that requires I specify my own newlines (everything else,
> the browser auto-wraps, which is the standard.)

Maybe you could use justify here, with -r set to however wide you want
each line to be, since it'll add newlines in the proper places then.  By
the way, out of curiosity, what blogging software are you using that
does this?

> I know this sounds like feature-creepism, but how difficult would this
> be to implement (even as an unofficial patch -- I'm willing to
> contribute something (webspace, beer, cash to the project), as this is
> my single biggest issue with pico/nano, but I still haven't been able
> to get myself to switch to vi/vim/emacs for a number of reasons.
Unfortunately, it would be very difficult.  The display and wrapping
routines would of course have to change to handle this.  Also, the way
nano keeps track of the number of lines, the number of characters, and
the current column in the file would have to change, and it would
introduce a lot of questions.  For example, if you're soft-wrapping one
very long line and it's displayed as two lines, how many lines should
nano say it has, and where should it say the cursor is positioned? While those questions can certainly be answered eventually, I don't want
to be asking them when nano's in a feature freeze and trying to become
the next stable version.  In any case, I added this request to the TODO
list, so it won't be forgotten.  Sorry I can't be of more help right

> Mainly because the behavior of nano is CONSISTENT wherever you use it.

That's good to hear.

> (Ideally, nano would also have a line-number indicator at column zero
> so one could actually SEE which lines didn't have numbers (and thus
> were soft-wrapped, but I know that's DEFINITELY more work -- and I
> know you guys are trying to maintain the relative simplicity of pico,
> and as much alike-behavior.

That's certainly another way to indicate soft-wrapping.  What do you
think of the extended whitespace display I mentioned above, though?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]