浏览代码

HackStudio: Show cursor line and column in the statusbar

Andreas Kling 5 年之前
父节点
当前提交
7eed2e968c
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      DevTools/HackStudio/main.cpp

+ 4 - 0
DevTools/HackStudio/main.cpp

@@ -57,6 +57,10 @@ int main(int argc, char** argv)
 
     auto statusbar = GStatusBar::construct(widget);
 
+    text_editor->on_cursor_change = [&] {
+        statusbar->set_text(String::format("Line: %d, Column: %d", text_editor->cursor().line(), text_editor->cursor().column()));
+    };
+
     window->show();
     return app.exec();
 }