Compare commits

..

No commits in common. "577f00dfef9d665a7429bdb0b55b0d9701f267f7" and "84dce8c53781f95d14e87e55ab8f527b87647f58" have entirely different histories.

5 changed files with 11 additions and 28 deletions

View File

@ -1,20 +1,5 @@
# 🎀 Changelog # 🎀 Changelog
## [1.2.0] - 2022-03-17
### Added
- Job Management additions
- `job.start` and `job.done` hooks (`doc hooks job`)
- `hilbish.jobs` interface (`get(id)` function gets a job object via `id`, `all()` gets all)
- Customizable runner/exec mode
- However Hilbish runs interactive user input can now be changed Lua side (`doc runner-mode`)
### Changed
- `vimMode` doc is now `vim-mode`
### Fixed
- Make sure input which is supposed to go in history goes there
- Cursor is right at the end of input on history search
## [1.1.0] - 2022-03-17 ## [1.1.0] - 2022-03-17
### Added ### Added
- `hilbish.vimAction` hook (`doc vimMode actions`) - `hilbish.vimAction` hook (`doc vimMode actions`)

View File

@ -100,12 +100,12 @@ func moveCursorBackwards(i int) {
printf("\x1b[%dD", i) printf("\x1b[%dD", i)
} }
func (rl *Instance) backspace(forward bool) { func (rl *Instance) backspace() {
if len(rl.line) == 0 || rl.pos == 0 { if len(rl.line) == 0 || rl.pos == 0 {
return return
} }
rl.deleteBackspace(forward) rl.deleteBackspace()
} }
func (rl *Instance) moveCursorByAdjust(adjust int) { func (rl *Instance) moveCursorByAdjust(adjust int) {

View File

@ -125,14 +125,14 @@ func (rl *Instance) deleteX() {
rl.updateHelpers() rl.updateHelpers()
} }
func (rl *Instance) deleteBackspace(forward bool) { func (rl *Instance) deleteBackspace() {
switch { switch {
case len(rl.line) == 0: case len(rl.line) == 0:
return return
case forward: case rl.pos == 0:
rl.line = append(rl.line[:rl.pos], rl.line[rl.pos+1:]...) rl.line = rl.line[1:]
case rl.pos > len(rl.line): case rl.pos > len(rl.line):
rl.backspace(forward) // There is an infite loop going on here... rl.backspace() // There is an infite loop going on here...
case rl.pos == len(rl.line): case rl.pos == len(rl.line):
rl.pos-- rl.pos--
rl.line = rl.line[:rl.pos] rl.line = rl.line[:rl.pos]

View File

@ -214,7 +214,7 @@ func (rl *Instance) Readline() (string, error) {
// Vim mode has different behaviors // Vim mode has different behaviors
if rl.InputMode == Vim { if rl.InputMode == Vim {
if rl.modeViMode == VimInsert { if rl.modeViMode == VimInsert {
rl.backspace(false) rl.backspace()
} else if rl.pos != 0 { } else if rl.pos != 0 {
rl.pos-- rl.pos--
} }
@ -223,7 +223,7 @@ func (rl *Instance) Readline() (string, error) {
} }
// Else emacs deletes a character // Else emacs deletes a character
rl.backspace(false) rl.backspace()
rl.renderHelpers() rl.renderHelpers()
} }
@ -517,9 +517,7 @@ func (rl *Instance) editorInput(r []rune) {
case VimReplaceMany: case VimReplaceMany:
for _, char := range r { for _, char := range r {
if rl.pos != len(rl.line) {
rl.deleteX() rl.deleteX()
}
rl.insert([]rune{char}) rl.insert([]rune{char})
} }
rl.refreshVimStatus() rl.refreshVimStatus()
@ -704,7 +702,7 @@ func (rl *Instance) escapeSeq(r []rune) {
if rl.modeTabFind { if rl.modeTabFind {
rl.backspaceTabFind() rl.backspaceTabFind()
} else { } else {
rl.deleteBackspace(true) rl.deleteBackspace()
} }
case seqHome, seqHomeSc: case seqHome, seqHomeSc:
if rl.modeTabCompletion { if rl.modeTabCompletion {

View File

@ -2,7 +2,7 @@ package main
// String vars that are free to be changed at compile time // String vars that are free to be changed at compile time
var ( var (
version = "v1.2.0" version = "v1.1.0"
defaultConfDir = "" // ~ will be substituted for home, path for user's default config defaultConfDir = "" // ~ will be substituted for home, path for user's default config
defaultHistDir = "" defaultHistDir = ""
commonRequirePaths = "';./libs/?/init.lua;./?/init.lua;./?/?.lua'" commonRequirePaths = "';./libs/?/init.lua;./?/init.lua;./?/?.lua'"