add Buffer::Iterator::INVALID_CODE_POINT constant

This commit is contained in:
Josh Holtrop 2016-12-28 13:24:52 -05:00
parent 929bda355f
commit 8df75f5ab0
2 changed files with 9 additions and 4 deletions

View File

@ -14,6 +14,11 @@ public:
class Iterator
{
public:
enum : uint32_t
{
INVALID_CODE_POINT = 0xFFFFFFFFu,
};
Iterator(Buffer * buffer)
{
m_buffer = buffer;
@ -51,7 +56,7 @@ public:
}
else
{
return 0xFFFFFFFFu;
return INVALID_CODE_POINT;
}
}
bool operator==(const Iterator & other) const

View File

@ -79,7 +79,7 @@ int BufferPane::rows_in_line(const Buffer::Iterator & start_of_line)
int saved_row_offset = 0;
walk_line(start_of_line, [&saved_row_offset](int row_offset, int screen_column, int virtual_column, int character_width, const Buffer::Iterator & i) {
uint32_t code_point = *i;
if ((code_point != '\n') && (code_point != 0xFFFFFFFFu))
if ((code_point != '\n') && (code_point != Buffer::Iterator::INVALID_CODE_POINT))
{
saved_row_offset = row_offset;
}
@ -97,7 +97,7 @@ int BufferPane::rows_in_line_with_iterator_offset(const Buffer::Iterator & start
m_cursor_virtual_column = virtual_column;
*iterator_row_offset = row_offset;
}
if ((code_point != '\n') && (code_point != 0xFFFFFFFFu))
if ((code_point != '\n') && (code_point != Buffer::Iterator::INVALID_CODE_POINT))
{
saved_row_offset = row_offset;
}
@ -226,7 +226,7 @@ int BufferPane::draw_buffer_line(int screen_row, const Buffer::Iterator & start_
/* TODO: highlight multi-column characters */
draw_cursor(x, y, m_buffer->insert_mode());
}
if ((code_point == '\n') || (code_point == 0xFFFFFFFFu))
if ((code_point == '\n') || (code_point == Buffer::Iterator::INVALID_CODE_POINT))
{
}
else