mirror of https://github.com/Hilbis/Hilbish
Compare commits
6 Commits
a5205dc24b
...
6d654b7768
Author | SHA1 | Date |
---|---|---|
sammyette | 6d654b7768 | |
sammyette | a5b6fc8eda | |
sammyette | 4421869b85 | |
sammyette | 6d07d8db53 | |
sammyette | 483e5f6dbe | |
sammyette | 83492e4e69 |
|
@ -16,6 +16,9 @@ completed.
|
|||
- Example: `hilbish.alias('hello', 'echo %1 says hello')` allows the user to run `hello hilbish`
|
||||
which will output `hilbish says hello`.
|
||||
|
||||
### Fixed
|
||||
- Return the prefix when calling `hilbish.completions.call`
|
||||
|
||||
[#219]: https://github.com/Rosettea/Hilbish/issues/219
|
||||
### Fixed
|
||||
- Replaced `sed` in-place editing with `grep` and `mv` for compatibility with BSD utils
|
||||
|
|
|
@ -51,6 +51,11 @@ func (a *aliasModule) Resolve(cmdstr string) string {
|
|||
arg, _ := regexp.Compile(`[\\]?%\d+`)
|
||||
|
||||
args, _ := splitInput(cmdstr)
|
||||
if len(args) == 0 {
|
||||
// this shouldnt reach but...????
|
||||
return cmdstr
|
||||
}
|
||||
|
||||
for a.aliases[args[0]] != "" {
|
||||
alias := a.aliases[args[0]]
|
||||
alias = arg.ReplaceAllStringFunc(alias, func(a string) string {
|
||||
|
|
|
@ -253,15 +253,16 @@ func callLuaCompleter(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
|
|||
}
|
||||
|
||||
// we must keep the holy 80 cols
|
||||
completerReturn, err := rt.Call1(l.MainThread(),
|
||||
rt.FunctionValue(completecb), rt.StringValue(query),
|
||||
rt.StringValue(ctx), rt.TableValue(fields))
|
||||
cont := c.Next()
|
||||
err = rt.Call(l.MainThread(), rt.FunctionValue(completecb),
|
||||
[]rt.Value{rt.StringValue(query), rt.StringValue(ctx), rt.TableValue(fields)},
|
||||
cont)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return c.PushingNext1(t.Runtime, completerReturn), nil
|
||||
return cont, nil
|
||||
}
|
||||
|
||||
// #interface completions
|
||||
|
|
|
@ -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
|
||||
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,
|
||||
instead of either like Fennel.
|
||||
Hilbish as a REPL. This also allows users to add alternative languages like
|
||||
Fennel as the interactive script runner.
|
||||
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue