File tree 3 files changed +15
-18
lines changed
modules/gdscript/tests/scripts
3 files changed +15
-18
lines changed Original file line number Diff line number Diff line change @@ -257,22 +257,6 @@ EditorPaths::EditorPaths() {
257
257
}
258
258
}
259
259
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
-
276
260
Engine::get_singleton ()->set_shader_cache_path (project_data_dir);
277
261
278
262
// Editor metadata dir.
Original file line number Diff line number Diff line change @@ -552,6 +552,21 @@ void ProjectDialog::ok_pressed() {
552
552
fa_icon->store_string (get_default_project_icon ());
553
553
554
554
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
+ }
555
570
}
556
571
557
572
// 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
-
3
1
# Some tests handle invalid syntax deliberately; exclude relevant attributes.
4
2
5
3
[parser/features/mixed_indentation_on_blank_lines.gd ]
You can’t perform that action at this time.
0 commit comments