Add BufferIterator::clamp(bool avoid_eol) method
This commit is contained in:
parent
390d4ccdfc
commit
416785f53c
|
@ -61,6 +61,8 @@ public:
|
|||
BufferIterator& operator++ ();
|
||||
BufferIterator& operator-- ();
|
||||
|
||||
void clamp(bool avoid_eol);
|
||||
|
||||
bool is_begin() const;
|
||||
bool is_end() const;
|
||||
bool is_valid() const;
|
||||
|
|
|
@ -28,6 +28,12 @@ inline bool BufferIterator::is_valid() const
|
|||
column() == m_buffer->m_lines.back().length()));
|
||||
}
|
||||
|
||||
inline void BufferIterator::clamp(bool avoid_eol)
|
||||
{
|
||||
assert(m_buffer);
|
||||
m_coord = m_buffer->clamp(m_coord, avoid_eol);
|
||||
}
|
||||
|
||||
inline bool BufferIterator::operator==(const BufferIterator& iterator) const
|
||||
{
|
||||
assert(m_buffer == iterator.m_buffer);
|
||||
|
|
Loading…
Reference in New Issue
Block a user