summaryrefslogtreecommitdiff
path: root/src/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/buffer.cc
parent97df6f22226d2854bea4441604b1b54f4fbb0a26 (diff)
DisplayBuffer: use coords rather than iterators
Diffstat (limited to 'src/buffer.cc')
-rw-r--r--src/buffer.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/buffer.cc b/src/buffer.cc
index c4de5a78..5e958cb8 100644
--- a/src/buffer.cc
+++ b/src/buffer.cc
@@ -159,17 +159,17 @@ LineCount Buffer::line_count() const
return LineCount(m_lines.size());
}
-String Buffer::string(const BufferIterator& begin, const BufferIterator& end) const
+String Buffer::string(const BufferCoord& begin, const BufferCoord& end) const
{
String res;
- for (LineCount line = begin.line(); line <= end.line(); ++line)
+ for (LineCount line = begin.line; line <= end.line; ++line)
{
ByteCount start = 0;
- if (line == begin.line())
- start = begin.column();
+ if (line == begin.line)
+ start = begin.column;
ByteCount count = -1;
- if (line == end.line())
- count = end.column() - start;
+ if (line == end.line)
+ count = end.column - start;
res += m_lines[line].content.substr(start, count);
}
return res;