summaryrefslogtreecommitdiff
path: root/src/display_buffer.cc
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-05-23 13:59:33 +0200
committerMaxime Coste <frrrwww@gmail.com>2013-05-30 13:59:38 +0200
commitd5b190369a9f326984071eee6122ec42943b2a68 (patch)
treeae8d6fc27a0f2c0a3a6a3612b9fcccde35e1d1b7 /src/display_buffer.cc
parent97df6f22226d2854bea4441604b1b54f4fbb0a26 (diff)
DisplayBuffer: use coords rather than iterators
Diffstat (limited to 'src/display_buffer.cc')
-rw-r--r--src/display_buffer.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/display_buffer.cc b/src/display_buffer.cc
index 2be1c8c3..c656410c 100644
--- a/src/display_buffer.cc
+++ b/src/display_buffer.cc
@@ -5,7 +5,7 @@
namespace Kakoune
{
-DisplayLine::iterator DisplayLine::split(iterator it, BufferIterator pos)
+DisplayLine::iterator DisplayLine::split(iterator it, BufferCoord pos)
{
kak_assert(it->content.type() == AtomContent::BufferRange);
kak_assert(it->content.begin() < pos);
@@ -67,8 +67,8 @@ CharCount DisplayLine::length() const
void DisplayBuffer::compute_range()
{
- m_range.first = BufferIterator();
- m_range.second = BufferIterator();
+ m_range.first = {INT_MAX,INT_MAX};
+ m_range.second = {0,0};
for (auto& line : m_lines)
{
for (auto& atom : line)
@@ -76,14 +76,13 @@ void DisplayBuffer::compute_range()
if (not atom.content.has_buffer_range())
continue;
- if (not m_range.first.is_valid() or m_range.first > atom.content.begin())
+ if (m_range.first > atom.content.begin())
m_range.first = atom.content.begin();
- if (not m_range.second.is_valid() or m_range.second < atom.content.end())
+ if (m_range.second < atom.content.end())
m_range.second = atom.content.end();
}
}
- kak_assert(m_range.first.is_valid() and m_range.second.is_valid());
kak_assert(m_range.first <= m_range.second);
}