[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: Fri, 16 Dec 2016 13:46:53 +0100

On Thu, Dec 15, 2016, at 20:55, Rishabh Dave wrote:
> Attached patch adds the ability to stay exactly at the same place.

8|  ...  Your patch adds more than sixty lines!

A detail:

+           line_size = help_line_len(ptr);
+           line = charalloc((line_size + 1) * sizeof(char));
+           snprintf(line, line_size + 1, "%s\n", ptr);
+           if (strcmp(edittop_line, line) == 0) {

...  What on earth are you doing?

There I stopped trying to understand what your code does.
I wrote my own version, in twenty three lines.  Pushed.

> However, there is still minute flaw. Under some cases where window
> size are changed to minimum, top line moves a line below as earlier
> top line is split into two. Is that fine?

That doesn't sound good.  You mean that only half of the original
top line would be shown?  A part of the text that before the resize
was visible at the top is no longer visible after the resize?

But never mind.  My version doesn't have that problem.  It has
another small deficiency: when the line before edittop is a blank
line, then this blank line is scrolled into view when the window
is resized.  If this can be fixed in at most three lines, okay;
otherwise, let it be.


-- - Choose from over 50 domains or use your own

reply via email to

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