1
Fork 0
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:
Andreas Kling 2019-03-07 00:46:29 +01:00
parent 9158de6c41
commit ca65ca2f2d
3 changed files with 31 additions and 20 deletions

View file

@ -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);