Compare commits

...

12 Commits

Author SHA1 Message Date
TorchedSammy e2c70a6014
chore: merge from master 2022-12-05 23:16:49 -04:00
TorchedSammy 26ff6c9a46
fix(nature/completions): get command name properly for custom completions 2022-12-05 23:15:35 -04:00
TorchedSammy 604dedb36d
chore: update lunacolors 2022-12-05 14:16:43 -04:00
TorchedSammy 395f3c0742
ci: remove extra indent in release action 2022-12-02 09:42:06 -04:00
TorchedSammy 0c44531a7f
chore: merge from upstream 2022-12-02 09:39:48 -04:00
TorchedSammy 4e850bb322
ci: set build version to 1.18, use task for release builds 2022-12-02 09:39:22 -04:00
TorchedSammy 09d04a7850 docs: [ci] generate new docs 2022-12-02 00:05:24 +00:00
TorchedSammy 4df37b4341
chore: merge from upstream 2022-12-01 20:04:55 -04:00
TorchedSammy 5e2b3367de
docs(bait): add annotation strings for release and hooks functions 2022-12-01 20:04:24 -04:00
Daniel de Sá b6aecb12f6
chore: add .editorconfig file (#217) 2022-12-01 09:29:27 -04:00
TorchedSammy 3f9b230381
chore: update changelog 2022-11-30 14:29:46 -04:00
TorchedSammy b395b70ecd
fix: escape completion prefix if completions are escaped
fixes an issue with duplicated characters when
completing escaped paths
2022-11-30 14:26:43 -04:00
9 changed files with 29 additions and 5 deletions

6
.editorconfig 100644
View File

@ -0,0 +1,6 @@
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = tab

View File

@ -25,7 +25,7 @@ jobs:
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: '1.17.7' go-version: '1.18.8'
- name: Download Task - name: Download Task
run: 'sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d' run: 'sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d'
- name: Build - name: Build

View File

@ -33,10 +33,13 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
- name: Download Task
run: 'sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d'
- uses: wangyoucao577/go-release-action@v1.25 - uses: wangyoucao577/go-release-action@v1.25
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }} goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }} goarch: ${{ matrix.goarch }}
build_command: task
binary_name: hilbish binary_name: hilbish
extra_files: LICENSE README.md CHANGELOG.md .hilbishrc.lua nature libs docs emmyLuaDocs extra_files: LICENSE README.md CHANGELOG.md .hilbishrc.lua nature libs docs emmyLuaDocs

View File

@ -77,7 +77,9 @@ random errors introduced with the new Lua runtime (see [#197])
- `bait.release(name, catcher)` removes `handler` for the named `event` - `bait.release(name, catcher)` removes `handler` for the named `event`
- `exec`, `clear` and `cat` builtin commands - `exec`, `clear` and `cat` builtin commands
- `hilbish.cancel` hook - `hilbish.cancel` hook
- 1st item on history is now inserted when history search menu is opened ([#148])
[#148]: https://github.com/Rosettea/Hilbish/issues/148
[#197]: https://github.com/Rosettea/Hilbish/issues/197 [#197]: https://github.com/Rosettea/Hilbish/issues/197
### Changed ### Changed
@ -158,6 +160,8 @@ will result in the files being completed.
- Fixed grid menu display if cell width ends up being the width of the terminal - Fixed grid menu display if cell width ends up being the width of the terminal
- Cut off item names in grid menu if its longer than cell width - Cut off item names in grid menu if its longer than cell width
- Fix completion search menu disappearing - Fix completion search menu disappearing
- Completion paths having duplicated characters if it's escaped
- Get custom completion command properly to call from Lua
## [2.0.0-rc1] - 2022-09-14 ## [2.0.0-rc1] - 2022-09-14
This is a pre-release version of Hilbish for testing. To see the changelog, This is a pre-release version of Hilbish for testing. To see the changelog,

View File

@ -161,6 +161,9 @@ func matchPath(query string) ([]string, string) {
entries = append(entries, entry) entries = append(entries, entry)
} }
} }
if !strings.HasPrefix(oldQuery, "\"") {
baseName = escapeFilename(baseName)
}
return entries, baseName return entries, baseName
} }

View File

@ -13,12 +13,16 @@ function bait.catch(name, cb) end
function bait.catchOnce(name, cb) end function bait.catchOnce(name, cb) end
--- Returns a table with hooks on the event with `name`. --- Returns a table with hooks on the event with `name`.
function bait.hooks() end --- @param name string
--- @returns table
function bait.hooks(name) end
--- Removes the `catcher` for the event with `name` --- Removes the `catcher` for the event with `name`
--- For this to work, `catcher` has to be the same function used to catch --- For this to work, `catcher` has to be the same function used to catch
--- an event, like one saved to a variable. --- an event, like one saved to a variable.
function bait.release() end --- @param name string
--- @param catcher function
function bait.release(name, catcher) end
--- Throws a hook with `name` with the provided `args` --- Throws a hook with `name` with the provided `args`
--- @param name string --- @param name string

View File

@ -286,6 +286,8 @@ func (b *Bait) bcatchOnce(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
// Removes the `catcher` for the event with `name` // Removes the `catcher` for the event with `name`
// For this to work, `catcher` has to be the same function used to catch // For this to work, `catcher` has to be the same function used to catch
// an event, like one saved to a variable. // an event, like one saved to a variable.
// --- @param name string
// --- @param catcher function
func (b *Bait) brelease(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) { func (b *Bait) brelease(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
name, catcher, err := util.HandleStrCallback(t, c) name, catcher, err := util.HandleStrCallback(t, c)
if err != nil { if err != nil {
@ -299,6 +301,8 @@ func (b *Bait) brelease(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
// hooks(name) -> {cb, cb...} // hooks(name) -> {cb, cb...}
// Returns a table with hooks on the event with `name`. // Returns a table with hooks on the event with `name`.
// --- @param name string
// --- @returns table
func (b *Bait) bhooks(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) { func (b *Bait) bhooks(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
if err := c.Check1Arg(); err != nil { if err := c.Check1Arg(); err != nil {
return nil, err return nil, err

@ -1 +1 @@
Subproject commit 8467b87dd8d49c68b4100b2d129d5f071544b8cf Subproject commit 34a57c964590f89aa065188a588c7b38aff99c28

View File

@ -24,7 +24,7 @@ function hilbish.completion.handler(line, pos)
return {compGroup}, pfx return {compGroup}, pfx
else else
local ok, compGroups, pfx = pcall(hilbish.completion.call, local ok, compGroups, pfx = pcall(hilbish.completion.call,
'command.' .. #fields[1], query, ctx, fields) 'command.' .. fields[1], query, ctx, fields)
if ok then if ok then
return compGroups, pfx return compGroups, pfx
end end