From d9583f8a7283bbeac1dceaf0885bba297961432e Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Thu, 24 Sep 2015 10:17:06 +0300 Subject: [PATCH] Add missing \n to world_wrap. Close #2516 The issue was that world_wrap would skip over newlines, without adding them to the output. --- core/ustring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ustring.cpp b/core/ustring.cpp index e5419effcb..7582376fe0 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3066,7 +3066,7 @@ String String::world_wrap(int p_chars_per_line) const { } else if (operator[](i)==' ' || operator[](i)=='\t') { last_space=i; } else if (operator[](i)=='\n') { - ret+=substr(from,i-from); + ret+=substr(from,i-from)+"\n"; from=i+1; last_space=-1; }