mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:12:43 +00:00 
			
		
		
		
	TextEditor: Allow "TextEditor foo.txt" to create a new file
Attempting to open a non-existent file from the command line should not fail, it should just open a new text document with that name. Note that the file is not created until you actually save it.
This commit is contained in:
		
							parent
							
								
									b59f4632d5
								
							
						
					
					
						commit
						d127492f0e
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -499,7 +499,7 @@ void TextEditorWidget::update_title() | |||
| void TextEditorWidget::open_sesame(const String& path) | ||||
| { | ||||
|     auto file = Core::File::construct(path); | ||||
|     if (!file->open(Core::IODevice::ReadOnly)) { | ||||
|     if (!file->open(Core::IODevice::ReadOnly) && file->error() != ENOENT) { | ||||
|         GUI::MessageBox::show(String::format("Opening \"%s\" failed: %s", path.characters(), strerror(errno)), "Error", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK, window()); | ||||
|         return; | ||||
|     } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling