1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 19:05:06 +00:00

GTextEditor: Add very basic automatic indentation.

This is off by default, but enabled by TextEditor. It simply inserts the
same number of leading spaces as the previous line when hitting Enter. :^)
This commit is contained in:
Andreas Kling 2019-04-25 22:56:09 +02:00
parent 8a3d00ac02
commit 71770e000b
5 changed files with 38 additions and 2 deletions

View file

@ -25,6 +25,7 @@ int main(int argc, char** argv)
auto* toolbar = new GToolBar(widget);
auto* text_editor = new GTextEditor(GTextEditor::MultiLine, widget);
text_editor->set_ruler_visible(true);
text_editor->set_automatic_indentation_enabled(true);
auto* statusbar = new GStatusBar(widget);
text_editor->on_cursor_change = [statusbar, text_editor] {