mirror of
https://github.com/RGBCube/serenity
synced 2025-05-18 05:55:07 +00:00
TextEditor: Show the current cursor position in the statusbar.
This commit is contained in:
parent
9158de6c41
commit
ca65ca2f2d
3 changed files with 31 additions and 20 deletions
|
@ -25,6 +25,10 @@ int main(int argc, char** argv)
|
|||
auto* text_editor = new GTextEditor(widget);
|
||||
auto* statusbar = new GStatusBar(widget);
|
||||
|
||||
text_editor->on_cursor_change = [statusbar] (GTextEditor& editor) {
|
||||
statusbar->set_text(String::format("Line: %d, Column: %d", editor.cursor().line(), editor.cursor().column()));
|
||||
};
|
||||
|
||||
{
|
||||
StringBuilder builder;
|
||||
int fd = open("/home/anon/ReadMe.md", O_RDONLY);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue