Skip to content

Commit

Permalink
screen_utils: remove redundant curs_set() call
Browse files Browse the repository at this point in the history
wreadln() already takes care for that.
  • Loading branch information
MaxKellermann committed Sep 6, 2024
1 parent 57f1d6d commit 5496991
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/screen_utils.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ screen_readln(ScreenManager &screen, const char *prompt,
const auto &window = screen.status_bar.GetWindow();

window.MoveCursor({0, 0});
curs_set(1);

if (prompt != nullptr) {
SelectStyle(window, Style::STATUS_ALERT);
Expand All @@ -105,10 +104,7 @@ screen_readln(ScreenManager &screen, const char *prompt,
SelectStyle(window, Style::STATUS);
window.AttributeOn(A_REVERSE);

auto result = wreadln(window, value, window.GetWidth(),
history, completion);
curs_set(0);
return result;
return wreadln(window, value, window.GetWidth(), history, completion);
}

std::string
Expand All @@ -117,7 +113,6 @@ screen_read_password(ScreenManager &screen, const char *prompt) noexcept
const auto &window = screen.status_bar.GetWindow();

window.MoveCursor({0, 0});
curs_set(1);
SelectStyle(window, Style::STATUS_ALERT);

if (prompt == nullptr)
Expand All @@ -129,9 +124,7 @@ screen_read_password(ScreenManager &screen, const char *prompt) noexcept
SelectStyle(window, Style::STATUS);
window.AttributeOn(A_REVERSE);

auto result = wreadln_masked(window, nullptr, window.GetWidth());
curs_set(0);
return result;
return wreadln_masked(window, nullptr, window.GetWidth());
}

static const char *
Expand Down

0 comments on commit 5496991

Please sign in to comment.