]> granicus.if.org Git - nethack/commitdiff
getpos fix (trunk only)
authornethack.rankin <nethack.rankin>
Mon, 12 Dec 2011 02:19:19 +0000 (02:19 +0000)
committernethack.rankin <nethack.rankin>
Mon, 12 Dec 2011 02:19:19 +0000 (02:19 +0000)
     This ought to fix the problem excountered by Ken, where the cursor
wasn't at the spot '/y' was reporting on.  This reverses part of a change
from May, 2005.  I still don't understand the original behavior, which
was that docrt() for ^R followed by positioning the cursor at a specific
map coordinate and calling flush_screen() was leaving the cursor at the
end of the second status line.  Reversing flush_screen and curs(WIN_MAP)
made it work for tty but screwed up X11.  It turns out that including
pline("Move cursor to %s:") *also* makes things work as intended, so that
the flush/position hack wasn't necessary once that other change went in
(same 2005 patch, but the cursor hack was implemented first at that time;
once this reversal is in place, commenting out the pline() does bring the
odd behavior for tty back).

src/do_name.c

index fe8bd6abe373ebcb2f124c651bbd78eb82bb8521..4b0cd5f4fc6157bed143804fcb5ffc142b01342e 100644 (file)
@@ -201,8 +201,8 @@ const char *goal;
 #ifdef CLIPPING
        cliparound(cx, cy);
 #endif
-       flush_screen(0);
        curs(WIN_MAP, cx, cy);
+       flush_screen(0);
     }
 #ifdef MAC
     lock_mouse_cursor(FALSE);