nano-devel
[Top][All Lists]
Advanced

[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: Sun, 13 Nov 2016 14:37:48 +0100

Hello Rishabh,

With your patch applied, run 'src/nano NEWS' and then
type: ^G ^X.  See how the titlebar still says "Main
nano help text" and "View".  You need to redraw the
titlebar when exiting from help.

Now type ^G ^W ^T ^T.  See how now all the shortcuts
from a normal search menu are displayed, and you can
type M-J to "justify" (that is: mess up) the help text.
I think it is best to remove ^T from MFINDINHELP.

Restart nano, type ^G, and resize the window.  See how
"View" disappears and the help text title gets replaced
with something like "File: /tmp/nano.8aZPYs".

On Sat, Nov 12, 2016, at 20:04, Rishabh Dave wrote:
> On Sat, Nov 12, 2016 at 2:14 AM, Benno Schulenberg
> <address@hidden> wrote:
> > Hm.  But if I do <AltGr+somekey>, it says: [ Unbound key: � ]
> 
> I could see something similar only after I changed me character locale
> to some other language not using basic Latin (or using something more
> that basic Latin; I don't have a AltGr key, used Alt key instead). For
> now I have disabled it. I /hope/ it is fixed.

It seems to be okay now, but haven't checked extensively.

> > The backward-search toggle can also go, so that ^Y and ^V get
> > grouped together.
> 
> Considering that we already have first line (^Y) and last line (^V) on
> the bottombars of help screen,

Not exactly: the shortcuts are M-\ and M-/.  But some people
might not like these combinations with Alt, or they are old
Pico users and are used to using ^W ^Y and ^W ^V to go to
top and bottom of a text.

> I think both of them are more redundant
> on search's bottombars than backward-search.

For now, remove everything that you don't /need/.
And all you need in MFINDINHELP is Cancel.

I would much rather have Re-search in the help menu.
So... I would say, put back the ^L Refresh shortcut, and
add ^W and M-W in the second column.

> > It spares you having to reindent a bunch of stuff.  (And, I've
> > told you before: don't bother with whitespace, don't change
> > lines that don't /need/ to be changed.)
> 
> I understand this is clearly a mistake in case of src/global.c
> [...] in my opinion, not changing the indentation would
> have been a mistake.

In theory yes, but the indentation is just a visual aid, to help
understand the logic, it doesn't have any effect on the actual
logic -- the compiler doesn't care.  So, to make reading your
patch easier, to make it easier to see /what/ you changed, don't
change lines where you don't change anything in the content.

More details about your patch:

+    help_text[strlen(help_text)] = '\0';

This looks silly.  For strlen() to work, the string has to end
with a null byte.  You're just putting a null byte where there
already is one.

+    p = help_text;

Don't use p, use ptr, like it was.

+    line_size = 0;

Superfluous.  It isn't used again.

Also, please add comment lines to explain the /intent/ of
blocks of code.

Benno

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




reply via email to

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