Rename iterator movement functions

This commit is contained in:
Josh Holtrop 2016-11-06 14:04:38 -05:00
parent 1db3853dab
commit 9dee74d18b
2 changed files with 14 additions and 14 deletions

View File

@ -34,7 +34,7 @@ std::shared_ptr<GapBuffer::Cursor> GapBuffer::add_cursor()
}
void GapBuffer::Iterator::forward()
void GapBuffer::Iterator::go_forward()
{
if (valid())
{
@ -42,12 +42,12 @@ void GapBuffer::Iterator::forward()
}
}
bool GapBuffer::Iterator::check_forward()
bool GapBuffer::Iterator::check_go_forward()
{
if (valid())
{
Iterator i2 = *this;
i2.forward();
i2.go_forward();
if (i2.valid())
{
m_offset = i2.m_offset;
@ -57,7 +57,7 @@ bool GapBuffer::Iterator::check_forward()
return false;
}
void GapBuffer::Iterator::back()
void GapBuffer::Iterator::go_back()
{
if (valid())
{
@ -74,12 +74,12 @@ void GapBuffer::Iterator::back()
}
}
bool GapBuffer::Iterator::check_back()
bool GapBuffer::Iterator::check_go_back()
{
if (valid())
{
Iterator i2 = *this;
i2.back();
i2.go_back();
if (i2.valid())
{
m_offset = i2.m_offset;
@ -93,7 +93,7 @@ bool GapBuffer::Iterator::check_back()
bool GapBuffer::Cursor::is_start_of_line()
{
Iterator i2 = m_iterator;
if (!i2.check_back())
if (!i2.check_go_back())
{
/* Iterator cannot go backwards so it is at beginning of buffer. */
return true;
@ -107,7 +107,7 @@ bool GapBuffer::Cursor::go_start_of_line()
Iterator i2 = m_iterator;
for (;;)
{
i2.back();
i2.go_back();
if (i2.valid() && (*i2 != '\n'))
{
moved = true;
@ -144,7 +144,7 @@ bool GapBuffer::Cursor::go_left()
if (!is_start_of_line())
{
uint32_t chr = *m_iterator;
if (m_iterator.check_back())
if (m_iterator.check_go_back())
{
if (chr == '\t')
{
@ -165,7 +165,7 @@ bool GapBuffer::Cursor::go_right()
{
if (!is_end_of_line())
{
if (m_iterator.check_forward())
if (m_iterator.check_go_forward())
{
uint32_t chr = *m_iterator;
if (chr == '\t')

View File

@ -22,10 +22,10 @@ public:
{
return m_offset < m_gap_buffer->size();
}
void forward();
bool check_forward();
void back();
bool check_back();
void go_forward();
bool check_go_forward();
void go_back();
bool check_go_back();
uint8_t * address() const
{
return m_gap_buffer->address(m_offset);