From 9b0dd4f571ff431e23b9097e7f29746f4157be12 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 15 Jun 2019 23:45:24 -0300 Subject: A lot of progress with canvas rendering, still far from working. --- core/ustring.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/ustring.cpp') diff --git a/core/ustring.cpp b/core/ustring.cpp index 8030efcc2b..c4543b89da 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -646,6 +646,17 @@ String String::camelcase_to_underscore(bool lowercase) const { return lowercase ? new_string.to_lower() : new_string; } +String String::get_with_code_lines() const { + Vector lines = split("\n"); + String ret; + for (int i = 0; i < lines.size(); i++) { + if (i > 0) { + ret += "\n"; + } + ret += itos(i + 1) + " " + lines[i]; + } + return ret; +} int String::get_slice_count(String p_splitter) const { if (empty()) -- cgit v1.2.3