nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] undoings of do_wrap()


From: Benno Schulenberg
Subject: [Nano-devel] undoings of do_wrap()
Date: Sun, 08 Jun 2014 14:24:00 +0200

Hi Mark,

On Sat, Jun 7, 2014, at 18:27, Mark Majeres wrote:
> Attached is an undo-redo patch for do_wrap().  The rules/functionality
> for do_wrap should be the same.  The only improvements are with
> undo/redo.

Wow.  In total nearly a hundred lines removed!  And it really does
the same as before, but even better?  :)

Thanks.  Will go into SVN tomorrow.

> I don't know if the previous functionality matched pico or what the
> reasoning was, but it doesn't behave the way I would expect it to.
> 
> Specifically, do_wrap only adjusts the current line and the one below
> it.

As far as I can tell, it does not affect the line below it -- it just
creates a new line below the current with the words that don't fit
any more on the current one.  And as long as you keep on typing,
it will add more words to that new line.  But as soon as you move
the cursor in any way, more additions will create another new line
with bumped-off words.

The thing is, as I tried to explain earlier, pico is not really an editor,
it is an email composer.  And normally, when you compose an email,
there is *no* text after the point where you are typing, so seen in
that light, the behaviour of do_wrap() makes perfect sense.  When
the typer goes back into her text to add or delete some words, the
justification of the paragraph will be broken -- but then a single ^J
will correct that *and* get the cursor back to the place where she
probably left off typing.  So, for those who don't use nowrap, or use
--fill, it is probably good to learn to use ^J.

> This can leave large 'gaps' on lines that had been wrapped in
> prior calls to do_wrap.  A manual do_justify() is then required by the
> user to remove the gaps and correctly align the edges.  If I
> understand, this is also the behavior James would like corrected.

I think James was talking only about softwrap -- about how things
are displayed on the screen, to have linebreaks there only on
whitespace.  As far as I can tell it was not about repositioning
actual linefeeds in the editing buffer.

> Should the behavior be changed to wrap then entire sentence?  Should
> it wrap the entire paragraph?

The default behaviour should not change.  What might be useful, though,
is to have an option, --autojustify, which would act as if one types ^J
after every keystroke (but without moving the cursor).

But again, let's hear the opinion of others.

Benno

-- 
http://www.fastmail.fm - IMAP accessible web-mail




reply via email to

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