~emersion/goguma-dev

Fix regression in compact message formatting v2 APPLIED

delthas: 1
 Fix regression in compact message formatting

 1 files changed, 3 insertions(+), 2 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~emersion/goguma-dev/patches/37955/mbox | git am -3
Learn more about email & git

[PATCH v2] Fix regression in compact message formatting Export this patch

A recent commit [1] broke mesage formatting in compact message mode.

Linkify was stripping all formatting, and the style was never passed
back before displaying it.

We can just wrap the TextSpan linkify returns in another TextSpan with
the current span style and with an only child that is the linkified
text span.

[1]: 6c7c51b029c9be8664c958279f632313bac5f193
---
 lib/page/buffer.dart | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/page/buffer.dart b/lib/page/buffer.dart
index 231d9dc..efb22aa 100644
--- a/lib/page/buffer.dart
+++ b/lib/page/buffer.dart
@@ -429,7 +429,7 @@ class _CompactMessageItem extends StatelessWidget {
		var textStyle = TextStyle(color: Theme.of(context).textTheme.bodyText1!.color);

		List<TextSpan> textSpans;
		if (ctcp != null && ctcp.cmd == 'ACTION') {
		if (ctcp != null) {
			textStyle = textStyle.apply(fontStyle: FontStyle.italic);

			if (ctcp.cmd == 'ACTION') {
@@ -442,7 +442,8 @@ class _CompactMessageItem extends StatelessWidget {
		}

		textSpans = textSpans.map((span) {
			return linkify(context, span.text!, linkStyle: TextStyle(decoration: TextDecoration.underline));
			var linkSpan = linkify(context, span.text!, linkStyle: TextStyle(decoration: TextDecoration.underline));
			return TextSpan(style: span.style, children: [linkSpan]);
		}).toList();

		List<Widget> stack = [];

base-commit: 5d84adafc1d8b61b05eaecb15d040e7297867a8d
-- 
2.39.0
Much better :)

Pushed, thanks!