2011-09-02 18:51:20 +02:00
|
|
|
#include "display_buffer.hh"
|
|
|
|
|
2011-09-29 11:10:27 +02:00
|
|
|
#include "assert.hh"
|
2011-09-29 10:55:08 +02:00
|
|
|
|
2011-09-02 18:51:20 +02:00
|
|
|
namespace Kakoune
|
|
|
|
{
|
|
|
|
|
2012-07-12 23:19:10 +02:00
|
|
|
DisplayLine::iterator DisplayLine::split(iterator it, BufferIterator pos)
|
2011-10-15 06:45:49 +02:00
|
|
|
{
|
2012-07-12 23:19:10 +02:00
|
|
|
assert(it->content.type() == AtomContent::BufferRange);
|
|
|
|
assert(it->content.begin() < pos);
|
|
|
|
assert(it->content.end() > pos);
|
2011-10-15 06:45:49 +02:00
|
|
|
|
2012-07-12 23:19:10 +02:00
|
|
|
DisplayAtom atom = *it;
|
|
|
|
atom.content.end() = pos;
|
|
|
|
it->content.begin() = pos;
|
|
|
|
return m_atoms.insert(it, std::move(atom));
|
2011-09-29 11:10:27 +02:00
|
|
|
}
|
|
|
|
|
2011-09-02 18:51:20 +02:00
|
|
|
}
|