kitty shell: Fix pressing enter while cursor is not at end of line causes line to be truncated visually

This commit is contained in:
Kovid Goyal 2022-11-26 15:30:49 +05:30
parent a721ffeb7d
commit b3f096b03b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,8 @@ func shell_loop(rl *readline.Readline, kill_if_signaled bool) (int, error) {
rl.Redraw()
return nil
}
rl.MoveCursorToEnd()
rl.Redraw()
lp.ClearToEndOfScreen()
return ErrExec
}

View File

@ -254,6 +254,10 @@ func (self *Readline) AllText() string {
return self.all_text()
}
func (self *Readline) MoveCursorToEnd() bool {
return self.move_to_end()
}
func (self *Readline) CursorAtEndOfLine() bool {
return self.input_state.cursor.X >= len(self.input_state.lines[self.input_state.cursor.Y])
}