diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2012-11-24 16:42:25 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2012-11-24 16:42:25 -0800 |
commit | 464f1f44aa368b75e68519a69a42ba3e87ffc528 (patch) | |
tree | 6b160a30b611305c18a49793db387e35abae973b /screen.h | |
parent | bf27cb1f5e16d23ddba01bd4678563f2d8c2ccf6 (diff) |
Improvements to avoid clearing the screen as often, which addresses a problem where the screen may be blank
Diffstat (limited to 'screen.h')
-rw-r--r-- | screen.h | 26 |
1 files changed, 24 insertions, 2 deletions
@@ -145,9 +145,13 @@ public: This flag is set to true when there is reason to suspect that the parts of the screen lines where the actual content is not filled in may be non-empty. This means that a clr_eol command - has to be sent to the terminal at the end of each line. + has to be sent to the terminal at the end of each line, including + actual_lines_before_reset. */ - bool need_clear; + bool need_clear_lines; + + /** Whether there may be yet more content after the lines, and we issue a clr_eos if possible. */ + bool need_clear_screen; /** If we need to clear, this is how many lines the actual screen had, before we reset it. This is used when resizing the window larger: if the cursor jumps to the line above, we need to remember to clear the subsequent lines. */ size_t actual_lines_before_reset; @@ -212,4 +216,22 @@ void s_write(screen_t *s, */ void s_reset(screen_t *s, bool reset_cursor, bool reset_prompt = true); + +enum screen_reset_mode_t { + /* Do not make a new line, do not repaint the prompt. */ + screen_reset_current_line_contents, + + /* Do not make a new line, do repaint the prompt. */ + screen_reset_current_line_and_prompt, + + /* Abandon the current line, go to the next one, repaint the prompt */ + screen_reset_abandon_line, + + /* Abandon the current line, go to the next one, clear the rest of the screen */ + screen_reset_abandon_line_and_clear_to_end_of_screen +}; + +void s_reset(screen_t *s, screen_reset_mode_t mode); + + #endif |