summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ncurses.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ncurses.cc b/src/ncurses.cc
index 2b7da02c..1570b75e 100644
--- a/src/ncurses.cc
+++ b/src/ncurses.cc
@@ -398,6 +398,10 @@ static DisplayCoord compute_needed_size(const String& str)
{
if (*begin == '\n')
{
+ // ignore last '\n', no need to show an empty line
+ if (begin+1 == end)
+ break;
+
res.column = std::max(res.column, line_len+1);
line_len = 0;
++res.line;