remove BufferIterator::offset

This commit is contained in:
Maxime Coste 2013-05-29 18:39:22 +02:00
parent dbb1c57ec9
commit ae947b456d
3 changed files with 1 additions and 8 deletions

View File

@ -71,7 +71,6 @@ public:
const BufferCoord& coord() const { return m_coord; } const BufferCoord& coord() const { return m_coord; }
LineCount line() const { return m_coord.line; } LineCount line() const { return m_coord.line; }
ByteCount column() const { return m_coord.column; } ByteCount column() const { return m_coord.column; }
ByteCount offset() const;
private: private:
safe_ptr<const Buffer> m_buffer; safe_ptr<const Buffer> m_buffer;

View File

@ -68,12 +68,6 @@ inline char BufferIterator::operator*() const
return m_buffer->at(m_coord); return m_buffer->at(m_coord);
} }
inline ByteCount BufferIterator::offset() const
{
kak_assert(m_buffer);
return m_buffer->offset(m_coord);
}
inline size_t BufferIterator::operator-(const BufferIterator& iterator) const inline size_t BufferIterator::operator-(const BufferIterator& iterator) const
{ {
kak_assert(m_buffer == iterator.m_buffer); kak_assert(m_buffer == iterator.m_buffer);

View File

@ -605,7 +605,7 @@ public:
BufferIterator begin{buffer, m_completions.begin}; BufferIterator begin{buffer, m_completions.begin};
for (auto& sel : m_context.editor().selections()) for (auto& sel : m_context.editor().selections())
{ {
auto offset = sel.last().offset(); auto offset = buffer.offset(sel.last());
if (offset > beg_offset and offset + end_offset < buffer_len and if (offset > beg_offset and offset + end_offset < buffer_len and
std::equal(sel.last() - beg_offset, sel.last(), begin)) std::equal(sel.last() - beg_offset, sel.last(), begin))
{ {