Compare commits

..

1 Commits

Author SHA1 Message Date
sammyette a5205dc24b
Merge 726082ba03 into 4fcd310048 2023-09-12 14:32:20 -06:00
4 changed files with 6 additions and 15 deletions

View File

@ -16,9 +16,6 @@ completed.
- Example: `hilbish.alias('hello', 'echo %1 says hello')` allows the user to run `hello hilbish` - Example: `hilbish.alias('hello', 'echo %1 says hello')` allows the user to run `hello hilbish`
which will output `hilbish says hello`. which will output `hilbish says hello`.
### Fixed
- Return the prefix when calling `hilbish.completions.call`
[#219]: https://github.com/Rosettea/Hilbish/issues/219 [#219]: https://github.com/Rosettea/Hilbish/issues/219
### Fixed ### Fixed
- Replaced `sed` in-place editing with `grep` and `mv` for compatibility with BSD utils - Replaced `sed` in-place editing with `grep` and `mv` for compatibility with BSD utils

View File

@ -51,11 +51,6 @@ func (a *aliasModule) Resolve(cmdstr string) string {
arg, _ := regexp.Compile(`[\\]?%\d+`) arg, _ := regexp.Compile(`[\\]?%\d+`)
args, _ := splitInput(cmdstr) args, _ := splitInput(cmdstr)
if len(args) == 0 {
// this shouldnt reach but...????
return cmdstr
}
for a.aliases[args[0]] != "" { for a.aliases[args[0]] != "" {
alias := a.aliases[args[0]] alias := a.aliases[args[0]]
alias = arg.ReplaceAllStringFunc(alias, func(a string) string { alias = arg.ReplaceAllStringFunc(alias, func(a string) string {

View File

@ -253,16 +253,15 @@ func callLuaCompleter(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
} }
// we must keep the holy 80 cols // we must keep the holy 80 cols
cont := c.Next() completerReturn, err := rt.Call1(l.MainThread(),
err = rt.Call(l.MainThread(), rt.FunctionValue(completecb), rt.FunctionValue(completecb), rt.StringValue(query),
[]rt.Value{rt.StringValue(query), rt.StringValue(ctx), rt.TableValue(fields)}, rt.StringValue(ctx), rt.TableValue(fields))
cont)
if err != nil { if err != nil {
return nil, err return nil, err
} }
return cont, nil return c.PushingNext1(t.Runtime, completerReturn), nil
} }
// #interface completions // #interface completions

View File

@ -13,8 +13,8 @@ is that it runs Lua first and then falls back to shell script.
In some cases, someone might want to switch to just shell script to avoid In some cases, someone might want to switch to just shell script to avoid
it while interactive but still have a Lua config, or go full Lua to use it while interactive but still have a Lua config, or go full Lua to use
Hilbish as a REPL. This also allows users to add alternative languages like Hilbish as a REPL. This also allows users to add alternative languages,
Fennel as the interactive script runner. instead of either like Fennel.
Runner mode can also be used to handle specific kinds of input before Runner mode can also be used to handle specific kinds of input before
evaluating like normal, which is how [Link.hsh](https://github.com/TorchedSammy/Link.hsh) evaluating like normal, which is how [Link.hsh](https://github.com/TorchedSammy/Link.hsh)