Skip to content

Commit e6c4939

Browse files
committed
fix: clean up
1 parent 4705ac0 commit e6c4939

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

lua/regexplainer.lua

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ local function show_for_real(options)
109109
{
110110
full_regexp_text = get_node_text(node, scratchnr),
111111
})
112-
return scratchnr
112+
vim.api.nvim_buf_delete(scratchnr, { force = true })
113113
else
114114
Buffers.hide_all()
115115
end
@@ -127,11 +127,8 @@ local M = {}
127127
---@param options? RegexplainerOptions
128128
function M.show(options)
129129
disable_auto = true
130-
local scratchnr = show_for_real(options)
130+
show_for_real(options)
131131
disable_auto = false
132-
if scratchnr then
133-
vim.api.nvim_buf_delete(scratchnr, { force = true })
134-
end
135132
end
136133

137134
--- Yank the explainer for the regexp under the cursor into a given register

lua/regexplainer/component/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ local get_node_text = vim.treesitter.get_node_text or vim.treesitter.query.get_n
2222
---@field children? RegexplainerComponent # Components may contain other components, e.g. capture groups
2323

2424
---@class RegexplainerCaptureGroupComponent : RegexplainerParentComponent
25-
---@field group_name? boolean # a regexp component marked with `+`
25+
---@field group_name? string # the name of the capture group, if it's a named group
2626
---@field capture_group? number # which capture group does this group represent?
2727

2828
---@alias RegexplainerComponentType

0 commit comments

Comments
 (0)