Skip to content

Alignment options - #82

Open
siseval wants to merge 4 commits into
areofyl:mainfrom
siseval:alignment-options
Open

Alignment options#82
siseval wants to merge 4 commits into
areofyl:mainfrom
siseval:alignment-options

Conversation

@siseval

@siseval siseval commented Aug 28, 2026

Copy link
Copy Markdown

Added enums for vertical and horizontal alignment, and expanded the config loader to find fields v_alignment and h_alignment. I also added these to the README.

v_alignment=bottom does leave a slightly bigger gap at the bottom than v_alignment=top does on top, as render_height over-estimates the height of the full render.

Otherwise seems to work :)

@areofyl areofyl left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The feature makes sense but the code needs a few fixes before merging:

  1. Style: 2-space indent, K&R braces (opening brace on same line), char * not char*. This is just to match the rest of the codebase
  2. Add static to get_alignment_padding()
  3. Add continue; after the config parsing blocks so they don't fall through
  4. Move the get_term_size() call out of the per-frame loop. Compute alignment once and recompute on SIGWINCH

@areofyl areofyl self-assigned this Aug 28, 2026
@areofyl areofyl added the enhancement New feature or request label Aug 28, 2026
@siseval

siseval commented Aug 29, 2026

Copy link
Copy Markdown
Author

Think I've cleaned up all the inconsistent syntax. Added continues in both config parse blocks. Terminal size is now calculated once on startup, and in the if (term_resized) block you already had, and cached in term_rows and term_cols. get_alignment_padding() is also static now.

@siseval
siseval requested a review from areofyl August 29, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants