feature: optional preview-buffer rendering for wrapped, navigable tables
维护者通常 6 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 需要澄清
- 活跃度
- 活跃
- 技术栈
- lua, markdown, neovim
调研方向
首先阅读现有的预览渲染器及其源与呈现的分离方式,然后跟踪表格渲染和刷新行为。将原型所需的投影、换行、源映射、调整大小以及编辑/光标行为与当前接口进行比较。当达成一致的可选预览模式或受支持的 companion plugin 接口能够保留源编辑、保存、导航和普通 Markdown 渲染时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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:
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
- 主要语言
- Lua
- 星标
- 5.2k
- 派生
- 145
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MeanderingProgrammer/render-markdown.nvim 的其他 Issue
-
bug
难度 4/5 1-2 天 新手友好度 55/100
MeanderingProgrammer/render-markdown.nvim#706 ·
维护者通常 6 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 38/100
MeanderingProgrammer/render-markdown.nvim#685 ·
维护者通常 6 天内回复
-
bug: Tables don't render correctly if the pipe at the end of line is missing可能已有人在做 @samholmes 于 94 天前认领。 未关闭bug
难度 3/5 1-2 天 新手友好度 55/100
MeanderingProgrammer/render-markdown.nvim#673 · 2 条评论 ·
维护者通常 6 天内回复
-
enhancement
难度 4/5 3-5 天 新手友好度 48/100
MeanderingProgrammer/render-markdown.nvim#656 ·
维护者通常 6 天内回复
查看 MeanderingProgrammer/render-markdown.nvim 的全部 Issue
相似的 Issue
-
bug
难度 1/5 1-3 小时 新手友好度 85/100
bradcypert/plum#265 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
-
code:todo
难度 1/5 1 小时以内 新手友好度 72/100
-
Enhancement
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
lua: LUA_32BITS is PRIVATE, so consumers get a different ABI than the compiled library可能已有人在做 @suda-morris 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 74/100
espressif/idf-extra-components#873 ·
维护者通常 1 天内回复