specialize BufferIterator::operator++ to speed up Kakoune
This commit is contained in:
parent
2e7cd2233c
commit
45e362d213
|
@ -193,7 +193,15 @@ inline BufferIterator& BufferIterator::operator-=(BufferSize size)
|
|||
|
||||
inline BufferIterator& BufferIterator::operator++()
|
||||
{
|
||||
return (*this += 1);
|
||||
if (column() < m_buffer->m_lines[line()].length() - 1)
|
||||
++m_coord.column;
|
||||
else if (line() == m_buffer->line_count() - 1)
|
||||
m_coord.column = m_buffer->m_lines.back().length();
|
||||
else
|
||||
{
|
||||
++m_coord.line;
|
||||
m_coord.column = 0;
|
||||
}
|
||||
}
|
||||
|
||||
inline BufferIterator& BufferIterator::operator--()
|
||||
|
|
Loading…
Reference in New Issue
Block a user