diff options
Diffstat (limited to 'Userland/Applications/TextEditor/main.cpp')
-rw-r--r-- | Userland/Applications/TextEditor/main.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Applications/TextEditor/main.cpp b/Userland/Applications/TextEditor/main.cpp index a6b6e09c82..11cab94012 100644 --- a/Userland/Applications/TextEditor/main.cpp +++ b/Userland/Applications/TextEditor/main.cpp @@ -76,19 +76,20 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) if (!file_to_edit.is_empty()) { auto filename = TRY(String::from_utf8(file_to_edit)); FileArgument parsed_argument(filename); + + FileSystemAccessClient::Client::the().set_silence_errors(FileSystemAccessClient::ErrorFlag::NoEntries); auto response = FileSystemAccessClient::Client::the().request_file_read_only_approved(window, parsed_argument.filename().to_deprecated_string()); if (response.is_error()) { if (response.error().code() == ENOENT) text_widget->open_nonexistent_file(parsed_argument.filename().to_deprecated_string()); - else - return 1; } else { TRY(text_widget->read_file(response.value().filename(), response.value().stream())); text_widget->editor().set_cursor_and_focus_line(parsed_argument.line().value_or(1) - 1, parsed_argument.column().value_or(0)); } text_widget->update_title(); + FileSystemAccessClient::Client::the().set_silence_errors(FileSystemAccessClient::ErrorFlag::None); } text_widget->update_statusbar(); |