Skip to content

feat(view): support padding around border characters#95

Merged
hat0uma merged 1 commit into
mainfrom
feat/support-padding-around-border-characters
May 2, 2026
Merged

feat(view): support padding around border characters#95
hat0uma merged 1 commit into
mainfrom
feat/support-padding-around-border-characters

Conversation

@hat0uma
Copy link
Copy Markdown
Owner

@hat0uma hat0uma commented May 2, 2026

Summary

This adds support for configuring virtual spacing on both sides of column delimiters.

Users can now write:

require("csvview").setup({
  view = {
    spacing = {
      left = 1,
      right = 1,
    },
  },
})

This makes crowded column-border layouts easier to read.

view.spacing = 2
(Default and existing behavior)
view.spacing = { left = 1, right = 1 }
(New spacing mode)
image image

Changes

  • Extend view.spacing to accept either:
    • a number, preserving the existing behavior
    • a table, { left = ..., right = ... }, for delimiter-aware spacing
  • Split field rendering padding into:
    • alignment padding, used to keep numeric/text columns aligned
    • delimiter spacing, used to add visual room around column borders
  • Add coverage for:
    • highlight display mode
    • border display mode
    • multiline fields
  • Update README and GUIDE with the new table-style spacing option

Notes

This does not add a new column-alignment configuration option yet. It preserves the current behavior where numeric fields are right-aligned and other fields are left-aligned, while making the spacing around delimiters configurable.

#94

@hat0uma hat0uma merged commit 5c22774 into main May 2, 2026
5 checks passed
@hat0uma hat0uma deleted the feat/support-padding-around-border-characters branch May 2, 2026 15:01
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