Skip to content

Fix log line leading space handled differently by Kodi Piers#19

Merged
enen92 merged 1 commit into
i96751414:matrixfrom
ksooo:fix-leading-spaces
May 24, 2026
Merged

Fix log line leading space handled differently by Kodi Piers#19
enen92 merged 1 commit into
i96751414:matrixfrom
ksooo:fix-leading-spaces

Conversation

@ksooo
Copy link
Copy Markdown
Contributor

@ksooo ksooo commented Apr 24, 2026

Fix
Preserve leading whitespace in log output (e.g. stack traces)

Problem
Leading spaces at the beginning of log lines (e.g. indented stack traces) are silently stripped when displayed in the Kodi textbox control, breaking the formatting of indented log content.

Root cause
The bug was introduced in Kodi 22 Piers (merged via xbmc/xbmc#27403) as an unintended side effect of a WrapText() performance optimization in GUITextLayout.cpp.
The new implementation introduced a skipLeadingSpaces lambda that is called after every line break during word-wrapping. While intended to avoid leading spaces after automatic line breaks, it inadvertently also strips intentional indentation at the start of lines that follow a wrapped line.

CGUITextBox is always initialized with wrap=true, so this code path is always active. The bug does not affect Kodi 21 Omega or earlier.

@sundermann fyi

@enen92 enen92 merged commit 6733783 into i96751414:matrix May 24, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants