Skip to content

Commit 8156620

Browse files
chore: Update multiple return type annotations and table test data
1 parent 4539c1a commit 8156620

File tree

8 files changed

+21
-22
lines changed

8 files changed

+21
-22
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
- Block code rendering with transparent background [#102](https://github.com/MeanderingProgrammer/markdown.nvim/pull/102)
4141
- Remove broken reference to `profiler` module [#105](https://github.com/MeanderingProgrammer/markdown.nvim/issues/105)
4242
[15d8e02](https://github.com/MeanderingProgrammer/markdown.nvim/commit/15d8e02663aa58f215ecadbcebbd34149b06a7bc)
43+
- Loading user configuration with vim-plug [#111](https://github.com/MeanderingProgrammer/markdown.nvim/issues/111)
44+
[4539c1a](https://github.com/MeanderingProgrammer/markdown.nvim/commit/4539c1a5d5f961c11bfee7622aa127f4b8a1de16)
4345

4446
### Collaborator Shoutouts
4547

benches/medium_table_spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ local util = require('benches.util')
44

55
describe('medium-table.md', function()
66
it('default', function()
7-
local base_marks = 30012
7+
local base_marks = 30698
88
util.between(450, 600, util.setup('temp/medium-table.md'))
99
util.num_marks(base_marks)
1010

benches/util.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ end
4141
---@param f fun()
4242
---@return number
4343
function M.time(f)
44-
local start_ns = vim.uv.hrtime()
44+
local start = vim.uv.hrtime()
4545
f()
46-
return (vim.uv.hrtime() - start_ns) / 1e+6
46+
return (vim.uv.hrtime() - start) / 1e+6
4747
end
4848

4949
---@private

justfile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ cat-log:
6161

6262
gen-medium:
6363
just gen-headings "1000" "temp/medium.md"
64-
just gen-table "5000" "temp/medium-table.md"
64+
just gen-table "50" "100" "temp/medium-table.md"
6565

6666
gen-large:
6767
just gen-headings "100000" "temp/large.md"
@@ -78,16 +78,17 @@ gen-headings-content lines:
7878
print(f"{level} Title {i}\n")
7979

8080
[private]
81-
gen-table lines path:
82-
{{path_exists(path)}} || just gen-table-contents {{lines}} > {{path}}
81+
gen-table tables lines path:
82+
{{path_exists(path)}} || just gen-table-contents {{tables}} {{lines}} > {{path}}
8383

8484
[private]
85-
gen-table-contents lines:
85+
gen-table-contents tables lines:
8686
#!/usr/bin/env python
87-
print("# Table")
88-
print()
89-
print(f"| `Column 1` | **Column 2** | *Column 3* |")
90-
print(f"| -------------- | :--------------- | -------------: |")
91-
for i in range({{lines}}):
92-
print(f"| Row {i:<4} Col 1 | `Row {i:<4} Col 2` | Row {i:<4} Col 3 |")
93-
print()
87+
for i in range({{tables}}):
88+
print(f"# Table {i}")
89+
print()
90+
print(f"| `Column 1` | **Column 2** | *Column 3* |")
91+
print(f"| -------------- | :--------------- | -------------: |")
92+
for j in range({{lines}}):
93+
print(f"| Row {j:<4} Col 1 | `Row {j:<4} Col 2` | Row {j:<4} Col 3 |")
94+
print()

lua/render-markdown/handler/markdown.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ end
198198
---@param buf integer
199199
---@param code_block render.md.parsed.CodeBlock
200200
---@param add_background boolean
201-
---@return render.md.Mark[]
202-
---@return boolean
201+
---@return render.md.Mark[], boolean
203202
function M.language(config, buf, code_block, add_background)
204203
local code = config.code
205204
if not vim.tbl_contains({ 'language', 'full' }, code.style) then

lua/render-markdown/handler/markdown_inline.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ end
6767
function M.callout(config, buf, info)
6868
---Support for overriding title: https://help.obsidian.md/Editing+and+formatting/Callouts#Change+the+title
6969
---@param callout render.md.CustomComponent
70-
---@return string
71-
---@return string?
70+
---@return string, string?
7271
local function custom_title(callout)
7372
local content = ts.parent(buf, info, 'inline')
7473
if content ~= nil then

lua/render-markdown/icons.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ local has_devicons, devicons = pcall(require, 'nvim-web-devicons')
55
local M = {}
66

77
---@param language string
8-
---@return string?
9-
---@return string?
8+
---@return string?, string?
109
function M.get(language)
1110
if has_mini_icons then
1211
---@diagnostic disable-next-line: return-type-mismatch

lua/render-markdown/parser/code_block.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ end
5050
---@param config render.md.Code
5151
---@param buf integer
5252
---@param info render.md.NodeInfo
53-
---@return integer
54-
---@return integer
53+
---@return integer, integer
5554
function M.get_width(config, buf, info)
5655
local lines = vim.api.nvim_buf_get_lines(buf, info.start_row, info.end_row, true)
5756
local code_width = vim.fn.max(vim.tbl_map(str.width, lines))

0 commit comments

Comments
 (0)