Make screen_reset_mode_t an enum class instead of an enum

Improves type safety.
This commit is contained in:
ridiculousfish
2020-04-28 11:00:14 -07:00
parent 844ae48dc0
commit 520c83cbbf
3 changed files with 17 additions and 17 deletions

View File

@@ -957,7 +957,7 @@ void reader_data_t::repaint_if_needed() {
if (needs_reset) {
exec_prompt();
s_reset(&screen, screen_reset_current_line_and_prompt);
s_reset(&screen, screen_reset_mode_t::current_line_and_prompt);
screen_reset_needed = false;
}
@@ -2313,7 +2313,7 @@ void reader_pop() {
reader_interactive_destroy();
} else {
s_end_current_loop = false;
s_reset(&new_reader->screen, screen_reset_abandon_line);
s_reset(&new_reader->screen, screen_reset_mode_t::abandon_line);
}
}
@@ -2652,7 +2652,7 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
// elsewhere, we detect if the mode output is empty.
exec_mode_prompt();
if (!mode_prompt_buff.empty()) {
s_reset(&screen, screen_reset_current_line_and_prompt);
s_reset(&screen, screen_reset_mode_t::current_line_and_prompt);
screen_reset_needed = false;
repaint();
break;
@@ -2665,7 +2665,7 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
if (!rls.coalescing_repaints) {
rls.coalescing_repaints = true;
exec_prompt();
s_reset(&screen, screen_reset_current_line_and_prompt);
s_reset(&screen, screen_reset_mode_t::current_line_and_prompt);
screen_reset_needed = false;
repaint();
}
@@ -2948,7 +2948,7 @@ void reader_data_t::handle_readline_command(readline_cmd_t c, readline_loop_stat
// already be printed, all we need to do is repaint.
wcstring_list_t argv(1, el->text());
event_fire_generic(parser(), L"fish_posterror", &argv);
s_reset(&screen, screen_reset_abandon_line);
s_reset(&screen, screen_reset_mode_t::abandon_line);
mark_repaint_needed();
}
@@ -3468,7 +3468,7 @@ maybe_t<wcstring> reader_data_t::readline(int nchars_or_0) {
history_search.reset();
s_reset(&screen, screen_reset_abandon_line);
s_reset(&screen, screen_reset_mode_t::abandon_line);
event_fire_generic(parser(), L"fish_prompt");
exec_prompt();