summaryrefslogtreecommitdiff
path: root/src/buffer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/buffer.cc')
-rw-r--r--src/buffer.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/buffer.cc b/src/buffer.cc
index 932b5532..93360b74 100644
--- a/src/buffer.cc
+++ b/src/buffer.cc
@@ -446,4 +446,11 @@ void Buffer::notify_saved()
}
}
+bool Buffer::is_valid(const BufferCoord& c) const
+{
+ return (c.line < line_count() and c.column < m_lines[c.line].length()) or
+ (c.line == line_count() - 1 and c.column == m_lines.back().length()) or
+ (c.line == line_count() and c.column == 0);
+}
+
}