mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibLine: Add a setter for the cursor position
This commit is contained in:
committed by
Andreas Kling
parent
dd682168a9
commit
2d7aaab897
@@ -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()); }
|
||||
|
||||
Reference in New Issue
Block a user