2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-21 21:13:22 +00:00

Compare commits

..

No commits in common. "e1f7d907a26194f696a6d9984f2ae7172fd5c146" and "c969f5ed155c93c55bdbc5a43c17d4876c0ac6eb" have entirely different histories.

7 changed files with 20 additions and 65 deletions

View File

@ -4,10 +4,8 @@
### Added
- Forward/Right arrow key will fill in hint text (#327)
## [2.3.4] - 2024-12-28
### Fixed
- Skip over file and prevent panic if info cannot be retrieved during file completion (due to permission error or anything else)
- Apply environment variables properly after 2.3 shell interpreter changes
## [2.3.3] - 2024-11-04
### Fixed
@ -789,7 +787,6 @@ This input for example will prompt for more input to complete:
First "stable" release of Hilbish.
[2.3.4]: https://github.com/Rosettea/Hilbish/compare/v2.3.3...v2.3.4
[2.3.3]: https://github.com/Rosettea/Hilbish/compare/v2.3.2...v2.3.3
[2.3.2]: https://github.com/Rosettea/Hilbish/compare/v2.3.1...v2.3.2
[2.3.1]: https://github.com/Rosettea/Hilbish/compare/v2.3.0...v2.3.1

View File

@ -17,7 +17,6 @@ func editorLoader(rtm *rt.Runtime) *rt.Table {
"getVimRegister": {editorGetRegister, 2, false},
"getLine": {editorGetLine, 0, false},
"readChar": {editorReadChar, 0, false},
"deleteByAmount": {editorDeleteByAmount, 1, false},
}
mod := rt.NewTable()
@ -107,21 +106,3 @@ func editorReadChar(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
return c.PushingNext1(t.Runtime, rt.StringValue(string(buf))), nil
}
// #interface editor
// deleteByAmount() -> string
// Reads a keystroke from the user. This is in a format of something like Ctrl-L.
func editorDeleteByAmount(t *rt.Thread, c *rt.GoCont) (rt.Cont, error) {
if err := c.Check1Arg(); err != nil {
return nil, err
}
amount, err := c.IntArg(0)
if err != nil {
return nil, err
}
lr.rl.DeleteByAmount(int(amount))
return c.Next(), nil
}

20
exec.go
View File

@ -434,8 +434,26 @@ func execHandle(bg bool) interp.ExecHandlerFunc {
// sh/interp but with our job handling
env := hc.Env
envList := os.Environ()
envList := make([]string, 0, 64)
env.Each(func(name string, vr expand.Variable) bool {
if name == "PATH" {
pathEnv := os.Getenv("PATH")
envList = append(envList, "PATH="+pathEnv)
return true
}
if !vr.IsSet() {
// If a variable is set globally but unset in the
// runner, we need to ensure it's not part of the final
// list. Seems like zeroing the element is enough.
// This is a linear search, but this scenario should be
// rare, and the number of variables shouldn't be large.
for i, kv := range envList {
if strings.HasPrefix(kv, name+"=") {
envList[i] = ""
}
}
}
if vr.Exported && vr.Kind == expand.String {
envList = append(envList, name+"="+vr.String())
}

View File

@ -1,36 +0,0 @@
local bait = require 'bait'
local hilbish = require 'hilbish'
hilbish.abbr = {
_abbrevs = {}
}
function hilbish.abbr.add(opts)
hilbish.abbr._abbrevs[opts.abbr] = opts
end
print 'abbr loaded'
hilbish.abbr.add {
abbr = 'tt',
expand = 'echo titties'
}
hilbish.abbr.add {
abbr = 'idk',
expand = 'i dont know',
anywhere = true
}
bait.catch('hilbish.rawInput', function(c)
-- 0x0d == enter
if c == ' ' or c == string.char(0x0d) then
-- check if the last "word" was a valid abbreviation
local line = hilbish.editor.getLine()
local lineSplits = string.split(line, ' ')
local thisAbbr = hilbish.abbr._abbrevs[lineSplits[#lineSplits]]
if thisAbbr and (#lineSplits == 1 or thisAbbr.anywhere == true) then
hilbish.editor.deleteByAmount(-lineSplits[#lineSplits]:len())
hilbish.editor.insert(thisAbbr.expand)
end
end
end)

View File

@ -24,7 +24,6 @@ require 'nature.opts'
require 'nature.vim'
require 'nature.runner'
require 'nature.hummingbird'
require 'nature.abbr'
local shlvl = tonumber(os.getenv 'SHLVL')
if shlvl ~= nil then

View File

@ -142,10 +142,6 @@ func (rl *Instance) viDeleteByAdjust(adjust int) {
rl.updateHelpers()
}
func (rl *Instance) DeleteByAmount(adjust int) {
rl.viDeleteByAdjust(adjust)
}
func (rl *Instance) vimDeleteToken(r rune) bool {
tokens, _, _ := tokeniseSplitSpaces(rl.line, 0)
pos := int(r) - 48 // convert ASCII to integer

View File

@ -11,7 +11,7 @@ var (
// Version info
var (
ver = "v2.3.4"
ver = "v2.3.3"
releaseName = "Alyssum"
gitCommit string