nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] [PATCH] bug #28994: [Request] enable search (^W) in help (^


From: Rishabh Dave
Subject: [Nano-devel] [PATCH] bug #28994: [Request] enable search (^W) in help (^G)
Date: Thu, 27 Oct 2016 01:15:54 +0530

Hello,

Link to the bug - https://savannah.gnu.org/bugs/?28994.

Attached patch is on the lines you proposed - writing help into a temp
file and then opening the buffer for the temp file (link to the
comment -
https://savannah.gnu.org/bugs/?28994#comment3).

There are few issues; more close to the implementation than the
solution itself, thus the mail instead of a comment on bug tracker.

First, in case of prompt and browser we redraw the screen (bottomwin
and edit, respectively). So, to display the help text on screen we
need to (re-)redraw it and (re-)relisten for shortcuts ("re-" because
this is done by default when a buffer is opened). Initially, I felt
this was an issue but later I felt it could be utilized as a solution
-- view mode won't have to become per file attribute; any attempt to
enter text would lead to statusbar message "Unbound key."

Second, nano generates a temporary file per ^G. That... /could/ be
pretty much and it stays till system reboots. Should it be of concern,
or that is fine?

Third, help text gets displayed unwrapped, so I hard-wrapped it to
make it look identical as it does now. Never saw help text occupying
the entire screen on maximizing terminal window, so took this
decision.

Most of the time was spent around fixing a segfault that occurred when
following was done after running src/nano - ^R, ^G, ^W, ^C and 'e' (no
other way to exit, also bottomwin remains stuck). Fix I came up with
required touching src/prompt.c. I don't know how good that is, but the
fix works. Also, similar issue, saving text entered at prompt when
doing another prompt (before completing the initial i.e. ^R, ^G and
^W), is handled right above and below do_search() in src/help.c.

Last, in help menu's bottomwin I have replaced positions of ^L by ^E
and ^E and ^W, since ^L is present many menus in nano and it is never
mentioned in bottombars; it looked like it was there only to avoid an
empty space, so I replaced it.


And, sorry for the late reply; got busy.  Testing isn't extensive and
code could still be optimized. I wanted to attached finished patch but
I figured I had already consuming lot of time.

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


reply via email to

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