Skip to content

Commit d6aaa19

Browse files
chore: update changelog
1 parent 05a740f commit d6aaa19

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
[9721ffe](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/9721ffe230ec90e49c49ee33b5ca44c3fc689214)
99
- blink.cmp source registration [b8d93e8](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/b8d93e83a02dadddc6a566b1f60dab87190c1296)
1010
[62d6681](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/62d6681332365cfddbe916c888752834d9f7ad0c)
11+
- improved completions [9f4ef68](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/9f4ef684da01016c270af2bc2b862eb6823aa7ab)
12+
- filter command completions [#372](https://github.com/MeanderingProgrammer/render-markdown.nvim/pull/372)
1113

1214
### Bug Fixes
1315

@@ -16,6 +18,7 @@
1618
### Collaborator Shoutouts
1719

1820
- @water-sucks
21+
- @williambdean
1922

2023
## 8.1.1 (2025-03-09)
2124

doc/render-markdown.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For 0.10.0 Last change: 2025 March 22
1+
*render-markdown.txt* For 0.10.0 Last change: 2025 March 23
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*

lua/render-markdown/command.lua

+16-16
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,16 @@ M.name = 'RenderMarkdown'
99
---@private
1010
M.plugin = 'render-markdown.nvim'
1111

12-
local starts_with = function(str, start)
13-
return str:sub(1, #start) == start
14-
end
15-
16-
local get_matching_values = function(value, potential_values)
17-
local matching_values = {}
18-
for _, potential_value in ipairs(potential_values) do
19-
if starts_with(potential_value, value) then
20-
table.insert(matching_values, potential_value)
21-
end
22-
end
23-
return matching_values
24-
end
25-
2612
---Should only be called from plugin directory
2713
function M.setup()
2814
vim.api.nvim_create_user_command(M.name, M.command, {
2915
nargs = '*',
3016
desc = M.plugin .. ' commands',
31-
complete = function(ArgLead, cmdline)
17+
complete = function(prefix, cmdline)
3218
if cmdline:find(M.name .. '%s+%S+%s+.*') then
3319
return {}
3420
elseif cmdline:find(M.name .. '%s+') then
35-
return get_matching_values(ArgLead, vim.tbl_keys(api))
21+
return M.matches(prefix, vim.tbl_keys(api))
3622
else
3723
return {}
3824
end
@@ -59,4 +45,18 @@ function M.command(opts)
5945
end
6046
end
6147

48+
---@private
49+
---@param prefix string
50+
---@param values string[]
51+
---@return string[]
52+
function M.matches(prefix, values)
53+
local result = {}
54+
for _, value in ipairs(values) do
55+
if vim.startswith(value, prefix) then
56+
table.insert(result, value)
57+
end
58+
end
59+
return result
60+
end
61+
6262
return M

lua/render-markdown/health.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local state = require('render-markdown.state')
55
local M = {}
66

77
---@private
8-
M.version = '8.1.7'
8+
M.version = '8.1.8'
99

1010
function M.check()
1111
M.start('version')

0 commit comments

Comments
 (0)