mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:37:46 +00:00
LibLine: Add a setter for the cursor position
This commit is contained in:
parent
dd682168a9
commit
2d7aaab897
1 changed files with 6 additions and 0 deletions
|
@ -204,6 +204,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t cursor() const { return m_cursor; }
|
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; }
|
const Vector<u32, 1024>& buffer() const { return m_buffer; }
|
||||||
u32 buffer_at(size_t pos) const { return m_buffer.at(pos); }
|
u32 buffer_at(size_t pos) const { return m_buffer.at(pos); }
|
||||||
String line() const { return line(m_buffer.size()); }
|
String line() const { return line(m_buffer.size()); }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue