diff --git a/src/window.cc b/src/window.cc index 5396f662..0b720ae5 100644 --- a/src/window.cc +++ b/src/window.cc @@ -272,6 +272,8 @@ CharCoord Window::display_position(ByteCoord coord) const ByteCoord Window::buffer_coord(CharCoord coord) const { + if (m_display_buffer.lines().empty()) + return {0,0}; if (coord <= 0_line) coord = {0,0}; if ((int)coord.line >= m_display_buffer.lines().size())