From ad9dced23192b951a71e57af04443530e72ec374 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 6 Sep 2024 18:18:43 +0200 Subject: [PATCH] wreadln: use wclrtoeol() instead of whline() --- src/wreadln.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wreadln.cxx b/src/wreadln.cxx index 65554bd6..c4142902 100644 --- a/src/wreadln.cxx +++ b/src/wreadln.cxx @@ -194,13 +194,13 @@ void wreadln::Paint() const noexcept { window.MoveCursor(point); - /* clear input area */ - window.HLine(width, ' '); /* print visible part of the line buffer */ if (masked) window.HLine(StringWidthMB(value.substr(start)), '*'); else window.String({value.c_str() + start, screen_to_bytes(value.c_str() + start, width)}); + /* clear the rest */ + window.ClearToEol(); /* move the cursor to the correct position */ window.MoveCursor({point.x + (int)GetCursorColumn(), point.y}); /* tell ncurses to redraw the screen */