Skip to content

Honor wraptext in curses persistent inventory#1576

Open
avgas3 wants to merge 1 commit into
NetHack:NetHack-5.0from
avgas3:codex/curses-perminv-wraptext
Open

Honor wraptext in curses persistent inventory#1576
avgas3 wants to merge 1 commit into
NetHack:NetHack-5.0from
avgas3:codex/curses-perminv-wraptext

Conversation

@avgas3

@avgas3 avgas3 commented Jun 7, 2026

Copy link
Copy Markdown

Summary

This updates the curses perm_invent display so that when wraptext is enabled, long persistent inventory entries wrap within the inventory window instead of being clipped and horizontally panned.

The existing non-wrapped behavior is preserved: perm_invent still clips long lines and supports horizontal panning when wraptext is disabled.

Details

  • Count persistent inventory display height in visual rows when wraptext is enabled.
  • Use the existing curses wrapping helpers, curses_num_lines() and curses_break_str(), for wrapped inventory text.
  • Align wrapped continuation lines under the item text after the inventory letter prefix.
  • Suppress horizontal panning controls while wrapped mode is active.
  • Clamp row offsets after resize or option changes so stale scroll positions remain valid.

Testing

  • Built successfully in an existing build-ready environment.
  • Verified manually in curses that wrapped persistent inventory entries respect terminal width when wraptext is enabled.
  • Verified that existing clipped/panned behavior remains available when wraptext is disabled.
  • Ran git diff --check.

@avgas3 avgas3 force-pushed the codex/curses-perminv-wraptext branch from 63c803e to 9f2937c Compare June 7, 2026 20:08
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.

1 participant