Skip to content

[fixed-] split columns based on header positions#2996

Open
saulbert wants to merge 1 commit intodevelopfrom
fix-fixed-width-header-columns
Open

[fixed-] split columns based on header positions#2996
saulbert wants to merge 1 commit intodevelopfrom
fix-fixed-width-header-columns

Conversation

@saulbert
Copy link
Collaborator

Summary

  • Fix columnize() to use the header (first row) to determine column start positions, preventing data with internal spaces (e.g. "very very very light") from creating false column splits. Closes [fixed] split columns based on header #2265.
  • Fix putValue() bug: was using self.j before the self.j or len(...) fallback, and len(row) instead of len(row[0]).

Test plan

  • New unit tests in visidata/tests/test_fixed_width.py
  • New golden test tests/edit-fixed.vdx (load, edit, save fixed-width)
  • Existing load-fixed golden unchanged
  • Updated pr2400 golden (first column no longer has leading spaces from blank header — cosmetic, join logic unaffected)
  • All 175 unit tests and 169 cmdlog tests pass

🤖 Generated with Claude Code

Data values with internal spaces (e.g. "very very very light") could
create false column splits when those spaces aligned across all rows.
Now uses the first row (header) to determine column start positions,
then finds column ends using data from all rows within those boundaries.

Also fix putValue to use row[0] length (not row length) and to apply
the j fallback before truncating value.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

[fixed] split columns based on header

1 participant