diff --git a/src/core/GapBuffer.cc b/src/core/GapBuffer.cc index 5a13cec..db436f2 100644 --- a/src/core/GapBuffer.cc +++ b/src/core/GapBuffer.cc @@ -34,7 +34,7 @@ std::shared_ptr 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') diff --git a/src/core/GapBuffer.h b/src/core/GapBuffer.h index 1926d75..0523fc9 100644 --- a/src/core/GapBuffer.h +++ b/src/core/GapBuffer.h @@ -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);