Fix \n not displayed (#11978)
Some checks are pending
Build all / Build Linux (push) Waiting to run
Build all / Build Non-Linux (push) Waiting to run
Build all / Unit Tests (push) Blocked by required conditions
Build all / Flatpak (push) Waiting to run

This commit is contained in:
Ian Bassi 2026-01-16 19:06:07 -03:00 committed by GitHub
parent eac352f95d
commit 97c8da4d03
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -710,6 +710,13 @@ void TextCtrl::BUILD() {
const ConfigOptionStrings *vec = m_opt.get_default_value<ConfigOptionStrings>();
if (vec == nullptr || vec->empty()) break; //for the case of empty default value
text_value = vec->get_at(m_opt_idx);
// For multiline fields, unescape newlines and other escape sequences
if (m_opt.multiline) {
std::string unescaped_value;
if (unescape_string_cstyle(text_value.ToStdString(), unescaped_value)) {
text_value = wxString::FromUTF8(unescaped_value);
}
}
break;
}
case coPoint:
@ -731,7 +738,7 @@ void TextCtrl::BUILD() {
: builder2.build(m_parent, "", "", "", wxDefaultPosition, size, wxTE_PROCESS_ENTER);
temp->SetLabel(_L(m_opt.sidetext));
auto text_ctrl = m_opt.multiline ? (wxTextCtrl *)temp : ((TextInput *) temp)->GetTextCtrl();
text_ctrl->SetLabel(text_value);
text_ctrl->SetValue(text_value);
temp->SetSize(size);
m_combine_side_text = !m_opt.multiline;
if (parent_is_custom_ctrl && m_opt.height < 0)