Skip to content

Commit 7986be4

Browse files
feat: add to error log when mark is not added
## Details When a mark fails to be added due to neovim version append an error to the logger. This should make debugging issues slightly easier, like with: #132 Log output will look something like: ``` 2024-08-14 11:59:57 [ERROR] inline marks require neovim >= 0.10.0: { conceal = true, opts = { conceal = "", end_col = 13, end_row = 4, virt_text = { { "󰌹 Basic One", "RenderMarkdownLink" } }, virt_text_pos = "inline" }, start_col = 0, start_row = 4 } 2024-08-14 11:59:57 [ERROR] inline marks require neovim >= 0.10.0: { conceal = true, opts = { conceal = "", end_col = 23, end_row = 6, virt_text = { { "󰌹 With Alias", "RenderMarkdownLink" } }, virt_text_pos = "inline" }, start_col = 0, start_row = 6 } ``` Updated issue template to ask for log output.
1 parent 72688ba commit 7986be4

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ body:
4545
description: Your configuration for this plugin.
4646
validations:
4747
required: true
48+
- type: textarea
49+
attributes:
50+
label: Plugin error log
51+
description: Error log stored in vim.fn.stdpath(state)/render-markdown.log, typically ~/.local/state/nvim/render-markdown.log, if file is missing put N/A.
52+
validations:
53+
required: true
4854
- type: checkboxes
4955
attributes:
5056
label: Confirmations

doc/render-markdown.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For 0.10.0 Last change: 2024 August 12
1+
*render-markdown.txt* For 0.10.0 Last change: 2024 August 14
22

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

lua/render-markdown/health.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local M = {}
55

66
---@private
77
---@type string
8-
M.version = '6.1.3'
8+
M.version = '6.1.4'
99

1010
function M.check()
1111
vim.health.start('render-markdown.nvim [version]')

lua/render-markdown/list.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ local M = {}
1111
---@param opts vim.api.keyset.set_extmark
1212
---@return boolean
1313
function M.add_mark(marks, conceal, start_row, start_col, opts)
14-
-- Inline extmarks require neovim >= 0.10.0
15-
if opts.virt_text_pos == 'inline' and not util.has_10 then
16-
return false
17-
end
1814
---@type render.md.Mark
1915
local mark = {
2016
conceal = conceal,
2117
start_row = start_row,
2218
start_col = start_col,
2319
opts = opts,
2420
}
21+
if opts.virt_text_pos == 'inline' and not util.has_10 then
22+
logger.error('inline marks require neovim >= 0.10.0', mark)
23+
return false
24+
end
2525
logger.debug('mark', mark)
2626
table.insert(marks, mark)
2727
return true

lua/render-markdown/logger.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ function M.debug(name, message)
7272
end
7373
end
7474

75-
---@private
7675
---@param name string
7776
---@param message any
7877
function M.error(name, message)

0 commit comments

Comments
 (0)