From e066a25cc56b8ba1e724c9b104ba7c425241a397 Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Mon, 17 Jun 2013 10:11:08 +0400 Subject: [PATCH] Ticket #2164: clarify cursor position in mcviewer. When viewing a file, the cursor's position is different in the slang and ncurses builds. With slang, the cursor is in the upper right corner, on the percent sign. With ncurses, the cursor wraps around to the beginning of the next line, that is, the top left corner of the actual file contents viewing area. In this commit, cursor is moved to upper right corner unconditionally after print of percentage value. Signed-off-by: Andrew Borodin --- src/viewer/display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/viewer/display.c b/src/viewer/display.c index dbdcee11c..5168ef82b 100644 --- a/src/viewer/display.c +++ b/src/viewer/display.c @@ -420,6 +420,8 @@ mcview_percent (mcview_t * view, off_t p) widget_move (view, top, right - 4); tty_printf ("%3d%%", percent); + /* avoid cursor wrapping in NCurses-base MC */ + widget_move (view, top, right - 1); } /* --------------------------------------------------------------------------------------------- */