[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: Rishabh Dave
Subject: Re: [Nano-devel] [PATCH] enable searching (^W) in a help text (^G)
Date: Sun, 20 Nov 2016 16:26:46 +0530

On Tue, Nov 15, 2016 at 7:38 PM, Benno Schulenberg
<address@hidden> wrote:
> With your patch applied, run 'src/nano NEWS' and then
> type: ^G ^W and resize the window. See how the titlebar
> now says something like "File: /tmp/nano.RYxXxw".

Created a function help_refresh() and used it instead of
total_refresh() when window size changes (code's at src/nano.c). This
required making the scope of the variable title static. Other way was
to make title global and then counter in src/search.c and
src/prompt.c. Besides addition of another global variable, this also
made the update in topwin visible (result of countering). So the
latter/other solution was rejected by me.

> Now make the window narrower and narrower.  See how the
> help text does not get rewrapped.  It should -- it does
> without your patch.

It does (without the patch) because text was not in a file, it was a
string -- absence of hard wrapping. In nano, that doesn't happen with
buffers until we enable soft wrap. Should the help_text be re-copied
to the file? The other way would be to enable soft wrap but that makes
the paragraphs look weird.

I've implemented the former solution. I had doubt that it might
introduce a lag but that did not happen.

I have attached to two more patches "restore-title.patch" and
"rewrap.patch" for the above issues individually (and respectively). I
thought that would make reviewing the code easier. Main patch includes
them anyways.

> More details: [...]

These are fixed. Also a comment or two have been rewritten by me for
clarity and one is added to indicate clearly that we are hard wrapping
the text in help.

Besides, if you do "./configure --disable-multibuffer && make" in the
git repo, nano won't even compile. That is because help text assumes
that we have facility of multiple buffers. Should old code (too) stay
for that (and, maybe, nano tiny too)?

Attachment: 0001-new-feature-add-search-facility-to-help.patch
Description: Text Data

Attachment: restore-title.patch
Description: Text Data

Attachment: rewrap.patch
Description: Text Data

reply via email to

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