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 f3d9d4bcc0 - Show all commits

View File

@ -23,9 +23,9 @@ EditorWidget::EditorWidget(SharedPtr<ui::Font> font) : ui::TextInput(), m_font(f
Result<void> EditorWidget::load_file(const os::Path& path)
{
struct stat st;
TRY(os::FileSystem::stat(path, st, true));
auto rc = os::FileSystem::stat(path, st, true);
if (!S_ISREG(st.st_mode))
if (!rc.has_error() && !S_ISREG(st.st_mode))
{
os::eprintln("editor: not loading %s as it is not a regular file", path.name().chars());
return {};