mirror of https://github.com/Hilbis/Hilbish
fix(readline): put cursor at end of text when exiting editor
parent
308e257872
commit
b4ca5bfda3
|
@ -245,7 +245,7 @@ func (rl *Instance) vi(r rune) {
|
|||
}
|
||||
|
||||
// Keep the previous cursor position
|
||||
prev := rl.pos
|
||||
//prev := rl.pos
|
||||
|
||||
new, err := rl.StartEditorWithBuffer(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.
|
||||
rl.clearLine()
|
||||
rl.line = new
|
||||
if prev > len(rl.line) {
|
||||
rl.pos = len(rl.line) - 1
|
||||
rl.pos = len(rl.line)
|
||||
/*if prev > len(rl.line) {
|
||||
} else {
|
||||
rl.pos = prev
|
||||
}
|
||||
}*/
|
||||
|
||||
case 'w':
|
||||
// If we were not yanking
|
||||
|
|
Loading…
Reference in New Issue