mirror of https://github.com/Hilbis/Hilbish
Compare commits
No commits in common. "e367eeb19daab41e23c922474b3b74ec0a299788" and "9eaa8ebe171a9cf0135dbe782a5d1301c8975410" have entirely different histories.
e367eeb19d
...
9eaa8ebe17
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
**NOTE:** Hilbish now uses [Task] insead of Make for builds.
|
**NOTE:** Hilbish now uses [Task] insead of Make for builds.
|
||||||
Windows support is also now at a lower tier; The only thing guaranteed is
|
|
||||||
Hilbish *compiling* on Windows.
|
|
||||||
|
|
||||||
[Task]: https://taskfile.dev/#/
|
[Task]: https://taskfile.dev/#/
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ and aims to be infinitely configurable. If something isn't, open an issue!
|
||||||
- [AUR](#AUR)
|
- [AUR](#AUR)
|
||||||
- [Nixpkgs](#Nixpkgs)
|
- [Nixpkgs](#Nixpkgs)
|
||||||
- [Manual Build](#Manual-Build)
|
- [Manual Build](#Manual-Build)
|
||||||
|
- [Getting Started](#Getting-Started)
|
||||||
- [Contributing](#Contributing)
|
- [Contributing](#Contributing)
|
||||||
|
|
||||||
# Screenshots
|
# Screenshots
|
||||||
|
@ -41,10 +42,6 @@ and aims to be infinitely configurable. If something isn't, open an issue!
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
**NOTE:** Hilbish is not guaranteed to work properly on Windows, starting
|
|
||||||
from the 2.0 version. It will still be able to compile, but functionality
|
|
||||||
may be lacking.
|
|
||||||
|
|
||||||
## Prebuilt binaries
|
## Prebuilt binaries
|
||||||
Go [here](https://nightly.link/Rosettea/Hilbish/workflows/build/master) for
|
Go [here](https://nightly.link/Rosettea/Hilbish/workflows/build/master) for
|
||||||
builds on the master branch.
|
builds on the master branch.
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
local bait = require 'bait'
|
local bait = require 'bait'
|
||||||
|
|
||||||
bait.catch('command.exit', function(_, cmd, priv)
|
bait.catch('command.exit', function(_, cmd, priv)
|
||||||
if not cmd then return end
|
|
||||||
if not priv and hilbish.opts.history then hilbish.history.add(cmd) end
|
if not priv and hilbish.opts.history then hilbish.history.add(cmd) end
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
package readline
|
package readline
|
||||||
|
|
||||||
import (
|
import "golang.org/x/text/width"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"golang.org/x/text/width"
|
|
||||||
)
|
|
||||||
|
|
||||||
// updateHelpers is a key part of the whole refresh process:
|
// updateHelpers is a key part of the whole refresh process:
|
||||||
// it should coordinate reprinting the input line, any Infos and completions
|
// it should coordinate reprinting the input line, any Infos and completions
|
||||||
|
@ -56,19 +52,19 @@ func (rl *Instance) updateReferences() {
|
||||||
rl.posY = 0
|
rl.posY = 0
|
||||||
rl.fullY = 0
|
rl.fullY = 0
|
||||||
|
|
||||||
var curLine []rune
|
var fullLine, cPosLine int
|
||||||
if len(rl.currentComp) > 0 {
|
if len(rl.currentComp) > 0 {
|
||||||
curLine = rl.lineComp
|
fullLine = getWidth(rl.lineComp)
|
||||||
|
cPosLine = getWidth(rl.lineComp[:rl.pos])
|
||||||
} else {
|
} else {
|
||||||
curLine = rl.line
|
fullLine = getWidth(rl.line)
|
||||||
|
cPosLine = getWidth(rl.line[:rl.pos])
|
||||||
}
|
}
|
||||||
fullLine := getWidth(curLine)
|
|
||||||
cPosLine := getWidth(curLine[:rl.pos])
|
|
||||||
|
|
||||||
// We need the X offset of the whole line
|
// We need the X offset of the whole line
|
||||||
toEndLine := rl.promptLen + fullLine
|
toEndLine := rl.promptLen + fullLine
|
||||||
fullOffset := toEndLine / GetTermWidth()
|
fullOffset := toEndLine / GetTermWidth()
|
||||||
rl.fullY = fullOffset + strings.Count(string(curLine), "\n")
|
rl.fullY = fullOffset
|
||||||
fullRest := toEndLine % GetTermWidth()
|
fullRest := toEndLine % GetTermWidth()
|
||||||
rl.fullX = fullRest
|
rl.fullX = fullRest
|
||||||
|
|
||||||
|
|
|
@ -245,7 +245,7 @@ func (rl *Instance) vi(r rune) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Keep the previous cursor position
|
// Keep the previous cursor position
|
||||||
//prev := rl.pos
|
prev := rl.pos
|
||||||
|
|
||||||
new, err := rl.StartEditorWithBuffer(multiline, "")
|
new, err := rl.StartEditorWithBuffer(multiline, "")
|
||||||
if err != nil || len(new) == 0 || string(new) == string(multiline) {
|
if err != nil || len(new) == 0 || string(new) == string(multiline) {
|
||||||
|
@ -257,11 +257,11 @@ func (rl *Instance) vi(r rune) {
|
||||||
// Clean the shell and put the new buffer, with adjusted pos if needed.
|
// Clean the shell and put the new buffer, with adjusted pos if needed.
|
||||||
rl.clearLine()
|
rl.clearLine()
|
||||||
rl.line = new
|
rl.line = new
|
||||||
rl.pos = len(rl.line)
|
if prev > len(rl.line) {
|
||||||
/*if prev > len(rl.line) {
|
rl.pos = len(rl.line) - 1
|
||||||
} else {
|
} else {
|
||||||
rl.pos = prev
|
rl.pos = prev
|
||||||
}*/
|
}
|
||||||
|
|
||||||
case 'w':
|
case 'w':
|
||||||
// If we were not yanking
|
// If we were not yanking
|
||||||
|
|
Loading…
Reference in New Issue