From b395b70ecdf6bfad7d0bfd6b09047a608f25aa7f Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Wed, 30 Nov 2022 14:26:43 -0400 Subject: [PATCH 1/9] fix: escape completion prefix if completions are escaped fixes an issue with duplicated characters when completing escaped paths --- complete.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/complete.go b/complete.go index 99da07f..c2a107c 100644 --- a/complete.go +++ b/complete.go @@ -161,6 +161,9 @@ func matchPath(query string) ([]string, string) { entries = append(entries, entry) } } + if !strings.HasPrefix(oldQuery, "\"") { + baseName = escapeFilename(baseName) + } return entries, baseName } From 3f9b23038192c84ff2f73491c70593ddf6b1aced Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Wed, 30 Nov 2022 14:29:46 -0400 Subject: [PATCH 2/9] chore: update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c02489..1c621d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -77,7 +77,9 @@ random errors introduced with the new Lua runtime (see [#197]) - `bait.release(name, catcher)` removes `handler` for the named `event` - `exec`, `clear` and `cat` builtin commands - `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 ### Changed @@ -158,6 +160,7 @@ will result in the files being completed. - 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 - Fix completion search menu disappearing +- Completion paths having duplicated characters if it's escaped ## [2.0.0-rc1] - 2022-09-14 This is a pre-release version of Hilbish for testing. To see the changelog, From b6aecb12f603ae89c660e52eb5cf733b2a3065d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20de=20S=C3=A1?= Date: Thu, 1 Dec 2022 10:29:27 -0300 Subject: [PATCH 3/9] chore: add .editorconfig file (#217) --- .editorconfig | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a06ed29 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +root = true + +[*] +charset = utf-8 +indent_size = 4 +indent_style = tab From 5e2b3367de00f2a50ecd4fd441334583fc9dea9d Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Thu, 1 Dec 2022 20:04:24 -0400 Subject: [PATCH 4/9] docs(bait): add annotation strings for release and hooks functions --- golibs/bait/bait.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/golibs/bait/bait.go b/golibs/bait/bait.go index f071f92..70e122c 100644 --- a/golibs/bait/bait.go +++ b/golibs/bait/bait.go @@ -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` // For this to work, `catcher` has to be the same function used to catch // 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) { name, catcher, err := util.HandleStrCallback(t, c) if err != nil { @@ -299,6 +301,8 @@ func (b *Bait) brelease(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) { // hooks(name) -> {cb, cb...} // 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) { if err := c.Check1Arg(); err != nil { return nil, err From 09d04a7850f25db730dbfe833eaf402538045ff2 Mon Sep 17 00:00:00 2001 From: TorchedSammy Date: Fri, 2 Dec 2022 00:05:24 +0000 Subject: [PATCH 5/9] docs: [ci] generate new docs --- emmyLuaDocs/bait.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/emmyLuaDocs/bait.lua b/emmyLuaDocs/bait.lua index c2c4b60..a957e00 100644 --- a/emmyLuaDocs/bait.lua +++ b/emmyLuaDocs/bait.lua @@ -13,12 +13,16 @@ function bait.catch(name, cb) end function bait.catchOnce(name, cb) end --- 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` --- For this to work, `catcher` has to be the same function used to catch --- 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` --- @param name string From 4e850bb3224e901b427c3f7ffc5d1608bc0c2775 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Fri, 2 Dec 2022 09:39:22 -0400 Subject: [PATCH 6/9] ci: set build version to 1.18, use task for release builds --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 371d284..4aab838 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2 with: - go-version: '1.17.7' + go-version: '1.18.8' - name: Download Task run: 'sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d' - name: Build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a3a2840..3165a2f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,10 +33,13 @@ jobs: - uses: actions/checkout@v3 with: submodules: true + - name: Download Task + run: 'sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d' - uses: wangyoucao577/go-release-action@v1.25 with: github_token: ${{ secrets.GITHUB_TOKEN }} goos: ${{ matrix.goos }} goarch: ${{ matrix.goarch }} + build_command: task binary_name: hilbish extra_files: LICENSE README.md CHANGELOG.md .hilbishrc.lua nature libs docs emmyLuaDocs From 395f3c0742511fcd5cf5b4c8c65e1b33616c3816 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Fri, 2 Dec 2022 09:42:06 -0400 Subject: [PATCH 7/9] ci: remove extra indent in release action --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3165a2f..9f9163d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,7 +34,7 @@ jobs: with: submodules: true - 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' - uses: wangyoucao577/go-release-action@v1.25 with: github_token: ${{ secrets.GITHUB_TOKEN }} From 604dedb36d172a18dd3b805412c9879766eac5d8 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Mon, 5 Dec 2022 14:16:43 -0400 Subject: [PATCH 8/9] chore: update lunacolors --- libs/lunacolors | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/lunacolors b/libs/lunacolors index 8467b87..34a57c9 160000 --- a/libs/lunacolors +++ b/libs/lunacolors @@ -1 +1 @@ -Subproject commit 8467b87dd8d49c68b4100b2d129d5f071544b8cf +Subproject commit 34a57c964590f89aa065188a588c7b38aff99c28 From 26ff6c9a46ae757963f7fdd9b075a99cc043c75e Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Mon, 5 Dec 2022 23:15:35 -0400 Subject: [PATCH 9/9] fix(nature/completions): get command name properly for custom completions --- CHANGELOG.md | 1 + nature/completions.lua | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c621d1..1a2c86e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -161,6 +161,7 @@ will result in the files being completed. - Cut off item names in grid menu if its longer than cell width - 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 This is a pre-release version of Hilbish for testing. To see the changelog, diff --git a/nature/completions.lua b/nature/completions.lua index d20cc59..f8127a1 100644 --- a/nature/completions.lua +++ b/nature/completions.lua @@ -24,7 +24,7 @@ function hilbish.completion.handler(line, pos) return {compGroup}, pfx else local ok, compGroups, pfx = pcall(hilbish.completion.call, - 'command.' .. #fields[1], query, ctx, fields) + 'command.' .. fields[1], query, ctx, fields) if ok then return compGroups, pfx end