Skip to content

Commit d6b04e3

Browse files
committed
fix(table): resolve variable mismatch rebase conflict issues
1 parent 2c808ae commit d6b04e3

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lua/render-markdown/render/markdown/table.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function Render:setup()
124124
-- uses the capped widths (padding is included in delim col width).
125125
if self.layout.wrap then
126126
for i, w in ipairs(self.layout.col_widths) do
127-
self.data.delim.cols[i].width = w + 2 * self.config.padding
127+
self.data.cols[i].width = w + 2 * self.config.padding
128128
end
129129
end
130130

@@ -164,7 +164,7 @@ function Render:compute_layout()
164164
-- Absolute character width
165165
available = math.floor(mtw)
166166
end
167-
local num_cols = #self.data.delim.cols
167+
local num_cols = #self.data.cols
168168
local padding = self.config.padding
169169

170170
-- Total table display width = (num_cols+1) pipes + num_cols*(2*padding + text_width)
@@ -176,12 +176,12 @@ function Render:compute_layout()
176176
local max_content = {} ---@type integer[]
177177
for i = 1, num_cols do
178178
max_content[i] = math.max(
179-
self.data.delim.cols[i].width - 2 * padding,
179+
self.data.cols[i].width - 2 * padding,
180180
self.config.min_width
181181
)
182182
end
183183
for _, row in ipairs(self.data.rows) do
184-
for i, col in ipairs(row.cols) do
184+
for i, col in ipairs(row.cells) do
185185
max_content[i] = math.max(max_content[i], col.width)
186186
end
187187
end
@@ -230,7 +230,7 @@ function Render:compute_layout()
230230
local needs_wrap = false
231231
for r, row in ipairs(self.data.rows) do
232232
local max_lines = 1
233-
for i, col in ipairs(row.cols) do
233+
for i, col in ipairs(row.cells) do
234234
local w = col_widths[i]
235235
if w > 0 and col.width > w then
236236
local lines = math.ceil(col.width / w)
@@ -561,15 +561,15 @@ function Render:row_wrapped(row, row_index)
561561

562562
-- Pre-compute display segments for each cell in this row
563563
local cell_segs = {} ---@type render.md.mark.Line[]
564-
for i, col in ipairs(row.cols) do
565-
cell_segs[i] = self:cell_segments(col.row, col.start_col, col.end_col)
564+
for i, col in ipairs(row.cells) do
565+
cell_segs[i] = self:cell_segments(col.node.start_row, col.node.start_col, col.node.end_col)
566566
end
567567

568568
local filler = self.config.filler
569569
local function build_line(visual_line)
570570
local line = self:line()
571571
line:pad(spaces, filler)
572-
for i, _ in ipairs(self.data.delim.cols) do
572+
for i, _ in ipairs(self.data.cols) do
573573
local col_width = self.layout.col_widths[i]
574574
line:text(border_icon, highlight)
575575
line:pad(padding, filler)

0 commit comments

Comments
 (0)