Skip to content

Commit

Permalink
Fix bug in apropos REPL commands
Browse files Browse the repository at this point in the history
Fix bug described in bakpakin#462
by stripping `_.G` from the input rather than the output of the
`apropos*` function.
  • Loading branch information
Wade Rance committed Jun 13, 2024
1 parent 88dbf21 commit 88aa46c
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/fennel/repl.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,7 @@ For more information about the language, see https://fennel-lang.org/reference")
;; _G. part is stripped from patterns to provide more stable output.
;; The order we traverse package.loaded is arbitrary, so we may see
;; top level functions either as is or under the _G module.
(let [names (apropos* pattern package.loaded "" {} [])]
(icollect [_ name (ipairs names)]
(name:gsub "^_G%." ""))))
(apropos* (pattern:gsub "^_G%." "") package.loaded "" {} []))

(fn commands.apropos [_env read on-values on-error _scope]
(run-command read on-error #(on-values (apropos (tostring $)))))
Expand Down

0 comments on commit 88aa46c

Please sign in to comment.