mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
TextEditor: Exit program when file is not opened
When trying to open files not permitted by the user, display the error message and exit.
This commit is contained in:
parent
67f01fd82e
commit
5df34f6567
3 changed files with 9 additions and 6 deletions
|
@ -90,9 +90,10 @@ int main(int argc, char** argv)
|
|||
app->set_menubar(menubar);
|
||||
|
||||
if (file_to_edit)
|
||||
text_widget.open_file(file_to_edit);
|
||||
else
|
||||
text_widget.update_title();
|
||||
if (!text_widget.open_file(file_to_edit))
|
||||
return 1;
|
||||
|
||||
text_widget.update_title();
|
||||
|
||||
if (initial_line_number != 0)
|
||||
text_widget.editor().set_cursor_and_focus_line(initial_line_number - 1, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue