Skip to content

Feat/multiline cell lf#50

Merged
kibi2 merged 1 commit intomainfrom
feat/multiline-cell-lf
Apr 6, 2026
Merged

Feat/multiline cell lf#50
kibi2 merged 1 commit intomainfrom
feat/multiline-cell-lf

Conversation

@kibi2
Copy link
Copy Markdown
Owner

@kibi2 kibi2 commented Apr 6, 2026

Summary

This PR introduces multiline cell rendering in tirenvi.

Cells containing line breaks (\n) are now rendered across multiple rows, enabling more natural and readable table editing.


Key Changes

  • Support rendering a single cell as multiple visual rows when it contains LF (\n)
  • Introduce continuation handling between rows
  • Add a lightweight buffer line cache for efficient upward/downward traversal
  • Update rendering behavior (including pipe and conceal handling) to support multiline layout

Design Notes

  • Multiline rendering is treated as a core rendering model, not an optional feature

  • Each visual row is internally linked using a continuation flag

  • Buffer access is optimized via a single-chunk cache tailored for directional scanning

  • This implementation serves as a foundation for upcoming features, such as:

    • column-width-based wrapping
    • fold support for multiline cells

Scope

This PR focuses on:

  • LF-based multiline rendering

It does not yet include:

  • column width wrapping (planned next)
  • fold integration (planned)

Testing

  • Added/updated test cases for buffer access and cache behavior

  • Verified correct behavior for:

    • multiline cell rendering
    • continuation handling
    • cache-based line access

Notes

This PR restructures part of the rendering pipeline, so reviewing the overall flow (rather than individual diffs) may be helpful.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

❌ Patch coverage is 95.43726% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lua/tirenvi/core/record.lua 89.28% 6 Missing ⚠️
lua/tirenvi/state/buffer.lua 94.82% 3 Missing ⚠️
lua/tirenvi/core/tir_vim.lua 97.61% 1 Missing ⚠️
lua/tirenvi/ui.lua 96.96% 1 Missing ⚠️
lua/tirenvi/util/log.lua 87.50% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@kibi2 kibi2 merged commit 0f91b95 into main Apr 6, 2026
3 checks passed
@kibi2 kibi2 deleted the feat/multiline-cell-lf branch April 6, 2026 07:55
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