소스 검색

Remove extraneous line breaks from text resources

Fixes #23539

(cherry picked from commit 9bbda4db2f946e1efc4b9a1bb8eef591dc70fc15)
Paul Trojahn 6 년 전
부모
커밋
0c3c4d61f7
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      scene/resources/resource_format_text.cpp

+ 4 - 2
scene/resources/resource_format_text.cpp

@@ -1645,7 +1645,8 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r
 			}
 		}
 
-		f->store_string("\n");
+		if (E->next())
+			f->store_line(String());
 	}
 
 	if (packed_scene.is_valid()) {
@@ -1714,7 +1715,8 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const RES &p_r
 				f->store_string(_valprop(String(state->get_node_property_name(i, j))) + " = " + vars + "\n");
 			}
 
-			f->store_line(String());
+			if (i < state->get_node_count() - 1)
+				f->store_line(String());
 		}
 
 		for (int i = 0; i < state->get_connection_count(); i++) {