diff --git a/src/terminal_ui.cc b/src/terminal_ui.cc index 9ebf7023..b334b4a9 100644 --- a/src/terminal_ui.cc +++ b/src/terminal_ui.cc @@ -85,7 +85,7 @@ void TerminalUI::Window::refresh(bool force) void TerminalUI::Window::move_cursor(DisplayCoord coord) { - cursor = coord; + cursor = {std::min(size.line-1, coord.line), std::min(size.column-1, coord.column)}; } void TerminalUI::Window::clear_line()