[Top][All Lists]

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

Re: [Nano-devel] [PATCH] enable searching (^W) in a help text (^G)

From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] enable searching (^W) in a help text (^G)
Date: Sat, 03 Dec 2016 12:30:41 +0100

On Fri, Dec 2, 2016, at 18:51, Rishabh Dave wrote:
> On Fri, Dec 2, 2016 at 4:55 PM, Benno Schulenberg
> <address@hidden> wrote:
> > what if nano dies while showing a help text?
> > Where did the buffer contents go?  The user doesn't know.
> > (And no: more explanations in the manual are no good.)
> > So no, not acceptable.
> No modification in die() or die_save_file() would help? We can open
> the old buffer there.

More complications, more code, more stuff to keep track of --

> Optimization was only complementary, but mainly I wrote it for a bug.
> Do this without the patch applied

You found a bug in unpatched nano?  Then please report it.

> src/nano, ^G, change the window
> size until the first line can contain only this "The nano editor is
> designed to emulate". Now, increase window size to something more than
> 76. Do this as fast you can without stopping at any value below 76.
> You will see the help text remains as it is.

No matter how fast I move the mouse, the help screen is rebuilt
soon after I start moving, and again at the end of the movement.
The help text never stays as it is -- it is always properly

What terminal are you using?  What window manager?  What distro?
What versions?  How do you resize the window?

> > Don't bother with
> > optimizations, just always recreate the help-text temp file when
> > the window is resized.  It makes things easier to understand.
> Well you confuse me. Sometimes you want optimization and sometimes not.

Where did I promote optimization at the cost of complication?

> > +           do_up(FALSE);
> > +           do_down(FALSE);
> >
> > Both those should use TRUE.  Pressing <Up> or <Down>
> > in the help text should immediately scroll the screen, not
> > move the cursor.
> With that you can scroll down screen till it goes completely blank.

Then stop it from doing that.  Ignore a <Down> when
edittop->lineno + editwinrows >= filebot->lineno.

> > +       } else if (func == do_research) {
> > +           do_research();
> >
> > It needs a 'focusing = TRUE' inserted to get the normal
> > behavior for re-searches back.
> What does focusing achieve, couldn't figure... I tried testing without
> and with making the change you asked for.

With your patch applied, run 'LANGUAGE=en src/nano --ignore --smooth',
then type: ^G M-/ ^W help <Enter> M-W M-W M-W M-W...
See how the cursor jumps alternatingly from top line to bottom line.
That is not the normal nano behavior for offscreen matches.
(Strangely this only happens when the end of the buffer has been
displayed, after an M-/ or multiple ^Vs.)

> > Only the introductory text should be wrapped at a maximum
> > of 74 columns, not the descriptions of the shortcuts -- those
> > should be wrapped at COLS.
> In that case long shortcut description won't be displayed completely.

Yes, they will.  Read it again.  When COLS is smaller that 74,
everything gets wrapped at COLS.  If COLS is bigger than 74,
the intro text gets wrapped at 74, the rest at COLS.


-- - A fast, anti-spam email service.

reply via email to

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