mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibLine: Add a setter for the cursor position
This commit is contained in:
parent
dd682168a9
commit
2d7aaab897
Notes:
sideshowbarker
2024-07-19 02:12:22 +09:00
Author: https://github.com/alimpfard
Commit: 2d7aaab897
Pull-request: https://github.com/SerenityOS/serenity/pull/3505
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/devsh0
1 changed files with 6 additions and 0 deletions
|
@ -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()); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue