Use in-line initialization for page_renderint_t's constructor

This commit is contained in:
ridiculousfish 2020-08-22 12:04:47 -07:00
parent c9d2c99a98
commit f24f952991
2 changed files with 12 additions and 21 deletions

View file

@ -856,13 +856,4 @@ size_t pager_t::cursor_position() const {
} }
// Constructor // Constructor
page_rendering_t::page_rendering_t() page_rendering_t::page_rendering_t() = default;
: term_width(-1),
term_height(-1),
rows(0),
cols(0),
row_start(0),
row_end(0),
selected_completion_idx(-1),
remaining_to_disclose(0),
search_field_shown(false) {}

View file

@ -19,19 +19,19 @@
/// Represents rendering from the pager. /// Represents rendering from the pager.
class page_rendering_t { class page_rendering_t {
public: public:
size_t term_width; size_t term_width{size_t(-1)};
size_t term_height; size_t term_height{size_t(-1)};
size_t rows; size_t rows{0};
size_t cols; size_t cols{0};
size_t row_start; size_t row_start{0};
size_t row_end; size_t row_end{0};
size_t selected_completion_idx; size_t selected_completion_idx{size_t(-1)};
screen_data_t screen_data; screen_data_t screen_data{};
size_t remaining_to_disclose; size_t remaining_to_disclose{0};
bool search_field_shown; bool search_field_shown{false};
editable_line_t search_field_line; editable_line_t search_field_line{};
// Returns a rendering with invalid data, useful to indicate "no rendering". // Returns a rendering with invalid data, useful to indicate "no rendering".
page_rendering_t(); page_rendering_t();