Skip to content

Commit

Permalink
fix: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed May 27, 2024
1 parent 4705ac0 commit e6c4939
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions lua/regexplainer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ local function show_for_real(options)
{
full_regexp_text = get_node_text(node, scratchnr),
})
return scratchnr
vim.api.nvim_buf_delete(scratchnr, { force = true })
else
Buffers.hide_all()
end
Expand All @@ -127,11 +127,8 @@ local M = {}
---@param options? RegexplainerOptions
function M.show(options)
disable_auto = true
local scratchnr = show_for_real(options)
show_for_real(options)
disable_auto = false
if scratchnr then
vim.api.nvim_buf_delete(scratchnr, { force = true })
end
end

--- Yank the explainer for the regexp under the cursor into a given register
Expand Down
2 changes: 1 addition & 1 deletion lua/regexplainer/component/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ local get_node_text = vim.treesitter.get_node_text or vim.treesitter.query.get_n
---@field children? RegexplainerComponent # Components may contain other components, e.g. capture groups

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

---@alias RegexplainerComponentType
Expand Down

0 comments on commit e6c4939

Please sign in to comment.