Skip to content

Conversation

@Godje
Copy link
Contributor

@Godje Godje commented Sep 30, 2025

Fixing the demo

  • Demo would not compile due to failure to check out the commit tags (they might have been squashed away or pruned).
  • Demo would crash instantly due to a "duplicate ID" issue. I statically assigned an ID to the component that was causing this trouble (termbox_settings).

Added horizontal scroll functionality

The termbox2 renderer and the demo supported scroll functionality previously, but they were never shown in the demo. I added horizontal scrolling for the user to be able to see the rest of the palette test window through .clip exactly as it is done in the documentation.

Things that will stay "broken"

Due to how string slices are rendered, horizontal scrolling will trim the string in the wrong direction. It seems that the only way to mitigate this without touching the renderer is to compute strings with the proper trimmed length, but computed strings would require allocating them outside of the layout build. Implementation of this would bloat the demo code, so I kept this out.

@nicbarker
Copy link
Owner

Thanks for fixing this one up! I just merged another commit that fixed the base issue that was causing the duplicate ID, but we can leave in the explicit ID cause I think it's a good ID to use explicit IDs where possible anyway 🙂

@Grazfather
Copy link

I guess this sort of obviates my PR #540.

@Godje
Copy link
Contributor Author

Godje commented Oct 14, 2025

@Grazfather yeah. I can technically close this PR and just leave my #525 open with the horizontal text culling fix. Either way, whichever gets merged will fix the first demo build.

@Grazfather
Copy link

Cool. I don't care either way, I just wanted the example to build, and I stole your code from #524, and missed that you had also pushed fixes for demo.

@nicbarker
Copy link
Owner

Apologies for the delay in getting this merged, thanks!

@nicbarker nicbarker merged commit 7216815 into nicbarker:main Oct 23, 2025
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.

3 participants