]> granicus.if.org Git - nethack/commit
clear stale prompt
authornethack.rankin <nethack.rankin>
Sat, 7 May 2005 03:52:52 +0000 (03:52 +0000)
committernethack.rankin <nethack.rankin>
Sat, 7 May 2005 03:52:52 +0000 (03:52 +0000)
commitbb190167850c9fbc7f86c18cf1546ee1e25231d4
tree2fbc19568ba9c1e749bc0f167f0b8c2e69c6708e
parent4b00bd86622e3ccf90afae02a749a0f25dfc0122
clear stale prompt

     From the newsgroup:  applying various types of tools (example was a
mirror; figurine is another case) and then typing <ESC> at the "In what
direction?" prompt would leave the prompt displayed.  User complained that
he tried to answer the no longer valid prompt--even though the cursor had
correctly moved back to the '@' on his map--and ended up walking into lava
instead.  Suggested fix in the newsgroup was to use pline("Never mind.")
the way many commands already do, but it's simpler and more robust to clear
the message window before getdir() returns.  Callers can issue Never_mind
feedback on a case by case basis as before; I haven't added any here.
Perhaps getpos() should get passed an extra argument telling it to issue
that message; then a dozen or so pline(Never_mind) calls could be removed.

     I also was annoyed that ^R gave me the command assist display instead
of redrawing the screen with the prompt intact.  This fixes it for getdir().
The corresponding fix for getpos() doesn't work correctly; it successfully
redraws the screen but leaves the cursor at the end of the 2nd status line,
despite the fact that it is followed by an existing cursor position call.
Can someone who understands the relevant windowing code fix ^R in getpos()?
(Easiest test case is probably just ^T in wizard mode.)  I have't added an
entry for ^R to the fixes file since it isn't fixed yet.  And I didn't look
to see whether yn_function() ought to handle ^R too; it might be used in
contexts where map redraws don't make sense.
doc/fixes34.4
src/cmd.c
src/do_name.c