summaryrefslogtreecommitdiff
path: root/wx+/no_flicker.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-09-07 18:49:36 +0000
committerB. Stack <bgstack15@gmail.com>2022-09-07 18:49:36 +0000
commit62bcefb8b809a32c6d26ab04ca686578bba5567a (patch)
treefbc1dea58a6b28f1af4a9e9b2bc8e3e1d23b2103 /wx+/no_flicker.h
parentMerge branch 'b11.23' into 'master' (diff)
parentadd upstream 11.24 (diff)
downloadFreeFileSync-62bcefb8b809a32c6d26ab04ca686578bba5567a.tar.gz
FreeFileSync-62bcefb8b809a32c6d26ab04ca686578bba5567a.tar.bz2
FreeFileSync-62bcefb8b809a32c6d26ab04ca686578bba5567a.zip
Merge branch 'b11.24' into 'master'11.24
add upstream 11.24 See merge request opensource-tracking/FreeFileSync!47
Diffstat (limited to 'wx+/no_flicker.h')
-rw-r--r--wx+/no_flicker.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/wx+/no_flicker.h b/wx+/no_flicker.h
index d8f2d6cd..7fa4ae23 100644
--- a/wx+/no_flicker.h
+++ b/wx+/no_flicker.h
@@ -85,20 +85,26 @@ void setTextWithUrls(wxRichTextCtrl& richCtrl, const wxString& newText)
urlStyle.SetTextColour(*wxBLUE);
urlStyle.SetFontUnderlined(true);
- for (const auto& [type, text] : blocks)
+ for (auto& [type, text] : blocks)
switch (type)
{
case BlockType::text:
+ if (endsWith(text, L"\n\n")) //bug: multiple newlines before a URL are condensed to only one;
+ //Why? fuck knows why! no such issue with double newlines *after* URL => hack this shit
+ text.RemoveLast().Append(ZERO_WIDTH_SPACE).Append(L'\n');
+
richCtrl.WriteText(text);
break;
case BlockType::url:
+ {
richCtrl.BeginStyle(urlStyle);
ZEN_ON_SCOPE_EXIT(richCtrl.EndStyle());
richCtrl.BeginURL(text);
ZEN_ON_SCOPE_EXIT(richCtrl.EndURL());
richCtrl.WriteText(text);
- break;
+ }
+ break;
}
if (std::any_of(blocks.begin(), blocks.end(), [](const auto& item) { return item.first == BlockType::url; }))
bgstack15