1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +00:00

TextEditor: Allow starting with a file argument that doesn't exist

If TextEditor is started with an argument for a file that doesn't
exist, we now allow editing it.

The file will be created once it is saved.
This commit is contained in:
Itamar 2021-07-21 20:35:52 +03:00 committed by Ali Mohammad Pur
parent 36bfc912fc
commit 8241a6c8eb
3 changed files with 28 additions and 14 deletions

View file

@ -25,6 +25,7 @@ class MainWidget final : public GUI::Widget {
public:
virtual ~MainWidget() override;
bool read_file_and_close(int fd, String const& path);
void open_nonexistent_file(String const& path);
bool request_close();
GUI::TextEditor& editor() { return *m_editor; }