From 88aa46c05ce04ca464abb80293c93d7e142bd124 Mon Sep 17 00:00:00 2001 From: Wade Rance Date: Thu, 13 Jun 2024 16:49:32 -0400 Subject: [PATCH] Fix bug in apropos REPL commands Fix bug described in https://github.com/bakpakin/Fennel/issues/462 by stripping `_.G` from the input rather than the output of the `apropos*` function. --- src/fennel/repl.fnl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/fennel/repl.fnl b/src/fennel/repl.fnl index ab00622b..ec2b3326 100644 --- a/src/fennel/repl.fnl +++ b/src/fennel/repl.fnl @@ -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 $)))))