Skip to content

Commit fca2903

Browse files
bug! Fix property boarder -> border
## Details Addresses: #54 New property `pipe_table.boarder` should be `pipe_table.border`. Added yesterday hopefully does not affect many users. To fix: - `pipe_table.boarder` -> `pipe_table.border`
1 parent 7acc1bf commit fca2903

File tree

6 files changed

+26
-26
lines changed

6 files changed

+26
-26
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,10 @@ require('render-markdown').setup({
250250
-- overlay: writes completely over the table, removing conceal behavior and highlights
251251
-- raw: replaces only the '|' characters in each row, leaving the cells completely unmodified
252252
cell = 'overlay',
253-
-- Characters used to replace table boarder
253+
-- Characters used to replace table border
254254
-- Correspond to top(3), delimiter(3), bottom(3), vertical, & horizontal
255255
-- stylua: ignore
256-
boarder = {
256+
border = {
257257
'', '', '',
258258
'', '', '',
259259
'', '', '',
@@ -449,10 +449,10 @@ require('render-markdown').setup({
449449
-- overlay: writes completely over the table, removing conceal behavior and highlights
450450
-- raw: replaces only the '|' characters in each row, leaving the cells completely unmodified
451451
cell = 'overlay',
452-
-- Characters used to replace table boarder
452+
-- Characters used to replace table border
453453
-- Correspond to top(3), delimiter(3), bottom(3), vertical, & horizontal
454454
-- stylua: ignore
455-
boarder = {
455+
border = {
456456
'', '', '',
457457
'', '', '',
458458
'', '', '',

doc/render-markdown.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For 0.10.0 Last change: 2024 July 08
1+
*render-markdown.txt* For 0.10.0 Last change: 2024 July 09
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*
@@ -286,10 +286,10 @@ Full Default Configuration ~
286286
-- overlay: writes completely over the table, removing conceal behavior and highlights
287287
-- raw: replaces only the '|' characters in each row, leaving the cells completely unmodified
288288
cell = 'overlay',
289-
-- Characters used to replace table boarder
289+
-- Characters used to replace table border
290290
-- Correspond to top(3), delimiter(3), bottom(3), vertical, & horizontal
291291
-- stylua: ignore
292-
boarder = {
292+
border = {
293293
'┌', '┬', '┐',
294294
'├', '┼', '┤',
295295
'└', '┴', '┘',
@@ -490,10 +490,10 @@ TABLES *render-markdown-setup-tables*
490490
-- overlay: writes completely over the table, removing conceal behavior and highlights
491491
-- raw: replaces only the '|' characters in each row, leaving the cells completely unmodified
492492
cell = 'overlay',
493-
-- Characters used to replace table boarder
493+
-- Characters used to replace table border
494494
-- Correspond to top(3), delimiter(3), bottom(3), vertical, & horizontal
495495
-- stylua: ignore
496-
boarder = {
496+
border = {
497497
'┌', '┬', '┐',
498498
'├', '┼', '┤',
499499
'└', '┴', '┘',

lua/render-markdown/handler/markdown.lua

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ M.render_node = function(namespace, buf, capture, node)
162162
if pipe_table.style ~= 'full' then
163163
return
164164
end
165-
local boarder = pipe_table.boarder
165+
local border = pipe_table.border
166166

167167
---@param row integer
168168
---@param s string
@@ -190,16 +190,16 @@ M.render_node = function(namespace, buf, capture, node)
190190
if delim_width == start_width and start_width == end_width then
191191
local headings = vim.split(delim_value, '|', { plain = true, trimempty = true })
192192
local lengths = vim.tbl_map(function(part)
193-
return boarder[11]:rep(vim.fn.strdisplaywidth(part))
193+
return border[11]:rep(vim.fn.strdisplaywidth(part))
194194
end, headings)
195195

196-
local line_above = boarder[1] .. table.concat(lengths, boarder[2]) .. boarder[3]
196+
local line_above = border[1] .. table.concat(lengths, border[2]) .. border[3]
197197
vim.api.nvim_buf_set_extmark(buf, namespace, start_row, start_col, {
198198
virt_lines_above = true,
199199
virt_lines = { { { line_above, pipe_table.head } } },
200200
})
201201

202-
local line_below = boarder[7] .. table.concat(lengths, boarder[8]) .. boarder[9]
202+
local line_below = border[7] .. table.concat(lengths, border[8]) .. border[9]
203203
vim.api.nvim_buf_set_extmark(buf, namespace, end_row, start_col, {
204204
virt_lines_above = true,
205205
virt_lines = { { { line_below, pipe_table.row } } },
@@ -210,7 +210,7 @@ M.render_node = function(namespace, buf, capture, node)
210210
if pipe_table.style == 'none' then
211211
return
212212
end
213-
local boarder = pipe_table.boarder
213+
local border = pipe_table.border
214214

215215
local highlight = pipe_table.head
216216
if capture == 'table_row' then
@@ -221,10 +221,10 @@ M.render_node = function(namespace, buf, capture, node)
221221
-- Order matters here, in particular handling inner intersections before left & right
222222
local row = value
223223
:gsub(' ', '-')
224-
:gsub('%-|%-', boarder[11] .. boarder[5] .. boarder[11])
225-
:gsub('|%-', boarder[4] .. boarder[11])
226-
:gsub('%-|', boarder[11] .. boarder[6])
227-
:gsub('%-', boarder[11])
224+
:gsub('%-|%-', border[11] .. border[5] .. border[11])
225+
:gsub('|%-', border[4] .. border[11])
226+
:gsub('%-|', border[11] .. border[6])
227+
:gsub('%-', border[11])
228228

229229
vim.api.nvim_buf_set_extmark(buf, namespace, start_row, start_col, {
230230
end_row = end_row,
@@ -236,7 +236,7 @@ M.render_node = function(namespace, buf, capture, node)
236236
vim.api.nvim_buf_set_extmark(buf, namespace, start_row, start_col, {
237237
end_row = end_row,
238238
end_col = end_col,
239-
virt_text = { { value:gsub('|', boarder[10]), highlight } },
239+
virt_text = { { value:gsub('|', border[10]), highlight } },
240240
virt_text_pos = 'overlay',
241241
})
242242
elseif pipe_table.cell == 'raw' then
@@ -245,7 +245,7 @@ M.render_node = function(namespace, buf, capture, node)
245245
vim.api.nvim_buf_set_extmark(buf, namespace, start_row, i - 1, {
246246
end_row = end_row,
247247
end_col = i - 1,
248-
virt_text = { { boarder[10], highlight } },
248+
virt_text = { { border[10], highlight } },
249249
virt_text_pos = 'overlay',
250250
})
251251
end

lua/render-markdown/health.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@ function M.check_config(config)
206206
append_errors('pipe_table', {
207207
style = one_of(pipe_table.style, { 'full', 'normal', 'none' }),
208208
cell = one_of(pipe_table.cell, { 'overlay', 'raw' }),
209-
boarder = { pipe_table.boarder, 'table' },
209+
border = { pipe_table.border, 'table' },
210210
head = { pipe_table.head, 'string' },
211211
row = { pipe_table.row, 'string' },
212212
})
213-
all_strings('pipe_table.boarder', pipe_table.boarder)
213+
all_strings('pipe_table.border', pipe_table.border)
214214

215215
for name, component in pairs(config.callout) do
216216
append_errors('callout.' .. name, {

lua/render-markdown/init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ local M = {}
1414
---@class render.md.UserPipeTable
1515
---@field public style? 'full'|'normal'|'none'
1616
---@field public cell? 'overlay'|'raw'
17-
---@field public boarder? string[]
17+
---@field public border? string[]
1818
---@field public head? string
1919
---@field public row? string
2020

@@ -224,10 +224,10 @@ M.default_config = {
224224
-- overlay: writes completely over the table, removing conceal behavior and highlights
225225
-- raw: replaces only the '|' characters in each row, leaving the cells completely unmodified
226226
cell = 'overlay',
227-
-- Characters used to replace table boarder
227+
-- Characters used to replace table border
228228
-- Correspond to top(3), delimiter(3), bottom(3), vertical, & horizontal
229229
-- stylua: ignore
230-
boarder = {
230+
border = {
231231
'', '', '',
232232
'', '', '',
233233
'', '', '',

lua/render-markdown/types.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---@class render.md.PipeTable
22
---@field public style 'full'|'normal'|'none'
33
---@field public cell 'overlay'|'raw'
4-
---@field public boarder string[]
4+
---@field public border string[]
55
---@field public head string
66
---@field public row string
77

0 commit comments

Comments
 (0)