Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

feature: optional preview-buffer rendering for wrapped, navigable tables

Đã đóng
#689 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 6 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
lua, markdown, neovim

Hướng nghiên cứu

Bắt đầu bằng cách đọc trình kết xuất bản xem trước hiện có và sự phân tách giữa nguồn với phần trình bày của nó, sau đó theo dõi việc kết xuất bảng và hành vi làm mới. So sánh phép chiếu, việc ngắt dòng, các ánh xạ nguồn, thay đổi kích thước và hành vi chỉnh sửa/con trỏ mà prototype yêu cầu với các interface hiện tại. Công việc được xem là hoàn tất khi có một chế độ bản xem trước tùy chọn đã được thống nhất hoặc một interface companion plugin được hỗ trợ, đồng thời vẫn giữ được việc chỉnh sửa nguồn, lưu, điều hướng và kết xuất Markdown thông thường.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement
Is your feature request related to a problem? Please describe.

Long table cells are difficult to read in narrow windows. Wrapping the underlying Markdown line does not
preserve the table's column layout, while generated virtual lines require additional handling for cursor
movement, selection, and copying.

Related requests include #536 and
#616.

Describe the solution you'd like

I have implemented a prototype that renders tables as real text rows in a separate preview buffer, while
keeping the original Markdown buffer responsible for editing, undo history, and saving.

Short columns retain their natural width where space permits. The remaining width is distributed among
longer columns. Cell contents wrap at word boundaries, with oversized words or identifiers split when
necessary. Each table row expands to accommodate its tallest cell.

Ordinary Markdown around the table continues to use render-markdown.nvim.

Demonstration:

Image

The GIF shows long descriptions wrapping beside aligned short cells, an oversized identifier splitting
across lines, cursor movement through wrapped content, visual selection and copying, and a quick status edit
followed by undo/redo.

Benefits

  • Readable tables within the window: long cells expand vertically while preserving column alignment.

  • Native navigation and copying: continuation rows are actual buffer lines, so movement, search, selection,
    and yanking work on their text.

  • Source-backed editing: supported edit commands return to the corresponding source cell; preview resumes
    afterward.

  • Incremental updates: unchanged table layouts can be cached, with only changed preview ranges updated.

Costs and limitations

The additional preview buffer requires memory, layout work, and source-position mappings. Those mappings
must account for wrapped lines, UTF-8, links, and inline formatting.

Editing also becomes more complex: the preview remains read-only, supported quick edits run in the source
buffer, and arbitrary visual edits require switching to source mode. Saving, modified state, link
navigation, and cursor restoration must preserve the source buffer's behavior.

The prototype demonstrates feasibility; it does not establish a performance improvement over the current
renderer.

Possible upstream support

The existing preview already separates source and presentation. Supporting this approach would additionally
require:

  • Table projection into real display rows, with highlights and source mappings.
  • A way to exclude generated table rows from ordinary Markdown parsing.
  • Refresh handling for source edits and window resizing, with source-position preservation.

This could be an optional preview mode or a supported interface for a companion plugin.

The same projection interface could later support Mermaid diagrams through an external renderer, though
precise diagram-to-source mapping would require additional metadata.

Describe alternatives you've considered

Using a separate table-viewing plugin is another option. It could open large tables in a dedicated buffer with wrapping, navigation, and copying support.

Additional information

No response

Ngôn ngữ chính
Lua
Star
5.2k
Fork
145
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của MeanderingProgrammer/render-markdown.nvim

Tất cả issue của MeanderingProgrammer/render-markdown.nvim

Issue tương tự

Thêm issue về Lua

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.