File tree Expand file tree Collapse file tree 3 files changed +15
-18
lines changed
modules/gdscript/tests/scripts Expand file tree Collapse file tree 3 files changed +15
-18
lines changed Original file line number Diff line number Diff line change @@ -257,22 +257,6 @@ EditorPaths::EditorPaths() {
257257 }
258258 }
259259
260- // Check that `.editorconfig` file exists.
261- String project_editorconfig_path = " res://.editorconfig" ;
262- if (!FileAccess::exists (project_editorconfig_path)) {
263- Ref<FileAccess> f = FileAccess::open (project_editorconfig_path, FileAccess::WRITE);
264- if (f.is_valid ()) {
265- f->store_line (" root = true" );
266- f->store_line (" " );
267- f->store_line (" [*]" );
268- f->store_line (" charset = utf-8" );
269- f->close ();
270- } else {
271- ERR_PRINT (" Failed to create file " + project_editorconfig_path.quote () + " ." );
272- }
273- FileAccess::set_hidden_attribute (project_editorconfig_path, true );
274- }
275-
276260 Engine::get_singleton ()->set_shader_cache_path (project_data_dir);
277261
278262 // Editor metadata dir.
Original file line number Diff line number Diff line change @@ -552,6 +552,21 @@ void ProjectDialog::ok_pressed() {
552552 fa_icon->store_string (get_default_project_icon ());
553553
554554 EditorVCSInterface::create_vcs_metadata_files (EditorVCSInterface::VCSMetadata (vcs_metadata_selection->get_selected ()), path);
555+
556+ // Ensures external editors and IDEs use UTF-8 encoding.
557+ const String editor_config_path = path.path_join (" .editorconfig" );
558+ Ref<FileAccess> f = FileAccess::open (editor_config_path, FileAccess::WRITE);
559+ if (f.is_null ()) {
560+ // .editorconfig isn't so critical.
561+ ERR_PRINT (" Couldn't create .editorconfig in project path." );
562+ } else {
563+ f->store_line (" root = true" );
564+ f->store_line (" " );
565+ f->store_line (" [*]" );
566+ f->store_line (" charset = utf-8" );
567+ f->close ();
568+ FileAccess::set_hidden_attribute (editor_config_path, true );
569+ }
555570 }
556571
557572 // Two cases for importing a ZIP.
Original file line number Diff line number Diff line change 1- # This file is required to workaround `.editorconfig` autogeneration (see #96845).
2-
31# Some tests handle invalid syntax deliberately; exclude relevant attributes.
42
53[parser/features/mixed_indentation_on_blank_lines.gd ]
You can’t perform that action at this time.
0 commit comments