Tolerate that the cursor might not be visible
Sometimes, like if the window is not high enough, we might not be able to display any buffer lines, hence not have the cursor visible. Fixes #1502
This commit is contained in:
parent
c625080ecf
commit
a9455bf132
|
@ -41,7 +41,8 @@ public:
|
|||
|
||||
virtual std::pair<CursorMode, DisplayCoord> get_cursor_info() const
|
||||
{
|
||||
DisplayCoord coord = *context().window().display_position(context().selections().main().cursor());
|
||||
const auto cursor = context().selections().main().cursor();
|
||||
auto coord = context().window().display_position(cursor).value_or(DisplayCoord{});
|
||||
return {CursorMode::Buffer, coord};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user