diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-02-12 19:26:14 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-02-12 19:26:14 +0000 |
| commit | a96a6c2c581b7046f81a600f42327691234ad1f8 (patch) | |
| tree | 02d46c05fcfa2a798683bef1bb18f2f08f4f89b4 /render.c | |
| parent | render: resize: temporarily disable row adjustment (diff) | |
render: resize; heuristics to prevent prompt from being printed on a newline
Diffstat (limited to 'render.c')
| -rw-r--r-- | render.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1229,15 +1229,15 @@ maybe_resize(struct terminal *term, int width, int height, bool force) while (cursor_row < 0) cursor_row += term->grid->num_rows; -#if 0 - if (term->cursor.point.col < term->cols - 1) + /* Heuristic to prevent a new prompt from being printed a new line */ + if (term->cursor.point.col > 0) cursor_row--; -#endif + else if (cursor_row >= term->rows) + term_linefeed(term); - assert(cursor_row < term->rows); term_cursor_to( term, - max(cursor_row, 0), + min(max(cursor_row, 0), term->rows - 1), min(term->cursor.point.col, term->cols - 1)); term->render.last_cursor.cell = NULL; |
