LibLine: Add a setter for the cursor position

This commit is contained in:
AnotherTest 2020-09-16 05:05:03 +04:30 committed by Andreas Kling
parent dd682168a9
commit 2d7aaab897
Notes: sideshowbarker 2024-07-19 02:12:22 +09:00

View File

@ -204,6 +204,12 @@ public:
}
size_t cursor() const { return m_cursor; }
void set_cursor(size_t cursor)
{
if (cursor > m_buffer.size())
cursor = m_buffer.size();
m_cursor = cursor;
}
const Vector<u32, 1024>& buffer() const { return m_buffer; }
u32 buffer_at(size_t pos) const { return m_buffer.at(pos); }
String line() const { return line(m_buffer.size()); }