Use get_slicec instead of get_slice for single character splitters

This commit is contained in:
A Thousand Ships 2024-11-16 17:16:07 +01:00
parent b5bdb88062
commit 466590d0ec
No known key found for this signature in database
GPG key ID: DEFC5A5B1306947D
58 changed files with 210 additions and 210 deletions

View file

@ -202,8 +202,8 @@ void EditorStandardSyntaxHighlighter::_update_cache() {
List<String> comments;
scr_lang->get_comment_delimiters(&comments);
for (const String &comment : comments) {
String beg = comment.get_slice(" ", 0);
String end = comment.get_slice_count(" ") > 1 ? comment.get_slice(" ", 1) : String();
String beg = comment.get_slicec(' ', 0);
String end = comment.get_slice_count(" ") > 1 ? comment.get_slicec(' ', 1) : String();
highlighter->add_color_region(beg, end, comment_color, end.is_empty());
}
@ -212,8 +212,8 @@ void EditorStandardSyntaxHighlighter::_update_cache() {
List<String> doc_comments;
scr_lang->get_doc_comment_delimiters(&doc_comments);
for (const String &doc_comment : doc_comments) {
String beg = doc_comment.get_slice(" ", 0);
String end = doc_comment.get_slice_count(" ") > 1 ? doc_comment.get_slice(" ", 1) : String();
String beg = doc_comment.get_slicec(' ', 0);
String end = doc_comment.get_slice_count(" ") > 1 ? doc_comment.get_slicec(' ', 1) : String();
highlighter->add_color_region(beg, end, doc_comment_color, end.is_empty());
}
@ -222,8 +222,8 @@ void EditorStandardSyntaxHighlighter::_update_cache() {
List<String> strings;
scr_lang->get_string_delimiters(&strings);
for (const String &string : strings) {
String beg = string.get_slice(" ", 0);
String end = string.get_slice_count(" ") > 1 ? string.get_slice(" ", 1) : String();
String beg = string.get_slicec(' ', 0);
String end = string.get_slice_count(" ") > 1 ? string.get_slicec(' ', 1) : String();
highlighter->add_color_region(beg, end, string_color, end.is_empty());
}
}
@ -443,7 +443,7 @@ void ScriptEditorQuickOpen::_confirmed() {
if (!ti) {
return;
}
int line = ti->get_text(0).get_slice(":", 1).to_int();
int line = ti->get_text(0).get_slicec(':', 1).to_int();
emit_signal(SNAME("goto_line"), line - 1);
hide();
@ -2111,10 +2111,10 @@ void ScriptEditor::_update_members_overview() {
for (int i = 0; i < functions.size(); i++) {
String filter = filter_methods->get_text();
String name = functions[i].get_slice(":", 0);
String name = functions[i].get_slicec(':', 0);
if (filter.is_empty() || filter.is_subsequence_ofn(name)) {
members_overview->add_item(name);
members_overview->set_item_metadata(-1, functions[i].get_slice(":", 1).to_int() - 1);
members_overview->set_item_metadata(-1, functions[i].get_slicec(':', 1).to_int() - 1);
}
}
@ -3681,7 +3681,7 @@ void ScriptEditor::_help_class_open(const String &p_class) {
}
void ScriptEditor::_help_class_goto(const String &p_desc) {
String cname = p_desc.get_slice(":", 1);
String cname = p_desc.get_slicec(':', 1);
if (_help_tab_goto(cname, p_desc)) {
return;
@ -3988,7 +3988,7 @@ void ScriptEditor::_on_find_in_files_result_selected(const String &fpath, int li
// Found the end of the script.
scr_id = line.get_slice(scr_header, 1);
scr_id = scr_id.get_slice("\"", 0);
scr_id = scr_id.get_slicec('"', 0);
scr_start_line = l + 1;
int scr_line_count = 0;