Add a basic GUI text editor #45

Merged
apio merged 9 commits from text-editor into main 2024-04-15 17:06:05 +00:00
Showing only changes of commit d6f7069589 - Show all commits

View File

@ -9,6 +9,7 @@
#include "EditorWidget.h"
#include <ctype.h>
#include <luna/PathParser.h>
#include <luna/Utf8.h>
#include <os/File.h>
#include <os/FileSystem.h>
@ -42,7 +43,9 @@ Result<void> EditorWidget::load_file(const os::Path& path)
m_path = path;
String title = TRY(String::format("Text Editor - %s"_sv, m_path.name().chars()));
auto basename = TRY(PathParser::basename(m_path.name()));
String title = TRY(String::format("Text Editor - %s"_sv, basename.chars()));
window()->set_title(title.view());
TRY(recalculate_lines());