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