diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-09-17 21:38:51 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-09-17 21:38:51 +0200 |
| commit | 81eae79154e5d8ea162962da7a817f0a1284e463 (patch) | |
| tree | 6814537179b6528879cf011baaed6b1261be78d7 /src | |
| parent | b245b39a85dc0c9ffcba96584a82c31c0407163e (diff) | |
ncurses: fix displaying of lines longer than screen
Diffstat (limited to 'src')
| -rw-r--r-- | src/ncurses.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ncurses.cc b/src/ncurses.cc index cf2072db..930a22d5 100644 --- a/src/ncurses.cc +++ b/src/ncurses.cc @@ -128,13 +128,15 @@ void NCursesClient::draw_window(Window& window) set_color(atom.fg_color, atom.bg_color); String content = atom.content.content(); - if (content[content.length()-1] == '\n') + int y,x; + getyx(stdscr, y,x); + if (content[content.length()-1] == '\n' and content.length() - 1 < max_x - x) { addnstr(content.c_str(), (int)content.length() - 1); addch(' '); } else - addstr(content.c_str()); + addnstr(content.c_str(), max_x - x); } ++line_index; } |
