mirror of
git://git.sv.gnu.org/nano.git
synced 2025-01-27 03:32:05 +03:00
Added print_numlock_warning(), code to figure out when numlock makes the keypad go bad.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@475 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
1748cd1d0f
commit
201d9bf467
@ -6,6 +6,9 @@ General
|
|||||||
- Previous change to #ifdefs DISABLE_TABCOMP and NANO_SMALL rolled
|
- Previous change to #ifdefs DISABLE_TABCOMP and NANO_SMALL rolled
|
||||||
back. (Rocco)
|
back. (Rocco)
|
||||||
- Various #ifdef & #ifndef cleanups. (Rocco)
|
- Various #ifdef & #ifndef cleanups. (Rocco)
|
||||||
|
- Added message for when keypad goes awry. Added code in main and
|
||||||
|
function print_numlock_warning() to notify user, and added an
|
||||||
|
apropriate section in the faq to refer to this brokenness.
|
||||||
- configure.in:
|
- configure.in:
|
||||||
- Fix for _use_keypad check breaking slang support (Christian
|
- Fix for _use_keypad check breaking slang support (Christian
|
||||||
Weisgerber).
|
Weisgerber).
|
||||||
@ -14,6 +17,7 @@ General
|
|||||||
- faq.html:
|
- faq.html:
|
||||||
- Added some info on making the binary smaller with the configure
|
- Added some info on making the binary smaller with the configure
|
||||||
script.
|
script.
|
||||||
|
- Added section on keypad bugginess.
|
||||||
- files.c:
|
- files.c:
|
||||||
real_dir_from_tilde()
|
real_dir_from_tilde()
|
||||||
- Oops, fix case where buf ="~", silly crash (bug discovered by
|
- Oops, fix case where buf ="~", silly crash (bug discovered by
|
||||||
|
29
faq.html
29
faq.html
@ -1,5 +1,6 @@
|
|||||||
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
|
||||||
<html>
|
<html>
|
||||||
|
<title>The nano editor FAQ</title>
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||||
<meta name="GENERATOR" content="Mozilla/4.73 [en] (X11; U; Linux 2.2.16 i586) [Netscape]">
|
<meta name="GENERATOR" content="Mozilla/4.73 [en] (X11; U; Linux 2.2.16 i586) [Netscape]">
|
||||||
@ -66,8 +67,11 @@ my window. How can I fix that?</a></font>
|
|||||||
<br><font color="#330000"><a href="#4.5">4.5. When I type in a
|
<br><font color="#330000"><a href="#4.5">4.5. When I type in a
|
||||||
search string, the string I last searched for is already in front of
|
search string, the string I last searched for is already in front of
|
||||||
my cursor! !What happened?!</a></font>
|
my cursor! !What happened?!</a></font>
|
||||||
<br><a href="#4.6">4.6 How do I make nano my default editor (in Pine,
|
<br><font color="#330000"><a href="#4.6">4.6. I get the message "NumLock
|
||||||
mutt, etc.)?</a></blockquote>
|
glitch detected. Keypad will malfunction without NumLock on." What
|
||||||
|
gives?</a></font>
|
||||||
|
<br><font color="#330000"><a href="#4.7">4.7. How do I make nano my
|
||||||
|
default editor (in Pine, mutt, etc.)?</a></font></blockquote>
|
||||||
|
|
||||||
<h2>
|
<h2>
|
||||||
<font color="#330000"><a href="#5">5. Internationalization</a></font></h2>
|
<font color="#330000"><a href="#5">5. Internationalization</a></font></h2>
|
||||||
@ -422,7 +426,26 @@ Meta-P while in nano (see the ^G help text for more
|
|||||||
details).</font></blockquote>
|
details).</font></blockquote>
|
||||||
|
|
||||||
<h2>
|
<h2>
|
||||||
<a NAME="4.6"></a>4.6. How do I make nano my default editor (in Pine,
|
<a NAME="4.6"></a>I get the message "NumLock glitch detected. Keypad
|
||||||
|
will malfunction without NumLock on." What gives?</h2>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
Nano (actually almost all console editors do) has issues when cycling
|
||||||
|
the NumLock key in certain X terminals (rxvt, aterm, wterm, etc...). When
|
||||||
|
you switch NumLock on to off, you put the terminal into an "application
|
||||||
|
mode" that changes what sequences are sent by the keypad. These sequences
|
||||||
|
vary sufficiently from terminal to terminal that it is nearly impossible
|
||||||
|
to work around them from within nano.
|
||||||
|
<br><br>
|
||||||
|
In a nutshell, if you want to be able to use the keypad with the arrow and
|
||||||
|
page up/down functionality, you have to exit nano and reset your terminal
|
||||||
|
(presumably with "reset" or "stty sane" or similar) and then run nano
|
||||||
|
again with NumLock off. If you know an easier way to restore "normal
|
||||||
|
mode", please mail <A href="nano@nano-editor.org">nano@nano-editor.org</A>.
|
||||||
|
<br> </blockquote>
|
||||||
|
|
||||||
|
<h2>
|
||||||
|
<a NAME="4.7"></a>4.7. How do I make nano my default editor (in Pine,
|
||||||
mutt, etc)?</h2>
|
mutt, etc)?</h2>
|
||||||
|
|
||||||
<blockquote>You need to make nano your $EDITOR. If you want this
|
<blockquote>You need to make nano your $EDITOR. If you want this
|
||||||
|
15
nano.c
15
nano.c
@ -2028,6 +2028,17 @@ void do_toggle(int which)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If the NumLock key has made the keypad gone awry, print an error
|
||||||
|
message, hopefully we can address it later. */
|
||||||
|
void print_numlock_warning(void)
|
||||||
|
{
|
||||||
|
static int didmsg = 0;
|
||||||
|
if (!didmsg) {
|
||||||
|
statusbar(_("NumLock glitch detected. Keypad will malfunction without NumLock on"));
|
||||||
|
didmsg = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* This function returns the correct keystroke, given the A,B,C or D
|
/* This function returns the correct keystroke, given the A,B,C or D
|
||||||
input key. This is a common sequence of many terms which send
|
input key. This is a common sequence of many terms which send
|
||||||
Esc-O-[A-D] or Esc-[-[A-D]. */
|
Esc-O-[A-D] or Esc-[-[A-D]. */
|
||||||
@ -2297,7 +2308,9 @@ int main(int argc, char *argv[])
|
|||||||
kbinput = wgetch(edit);
|
kbinput = wgetch(edit);
|
||||||
if (kbinput <= 'D' && kbinput >= 'A')
|
if (kbinput <= 'D' && kbinput >= 'A')
|
||||||
kbinput = ABCD(kbinput);
|
kbinput = ABCD(kbinput);
|
||||||
if (kbinput <= 'S' && kbinput >= 'P')
|
else if (kbinput <= 'z' && kbinput >= 'j')
|
||||||
|
print_numlock_warning();
|
||||||
|
else if (kbinput <= 'S' && kbinput >= 'P')
|
||||||
kbinput = KEY_F(kbinput - 79);
|
kbinput = KEY_F(kbinput - 79);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user