mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 18:51:41 +02:00
Fix another bug in readline cursor position tracking
This commit is contained in:
@@ -107,6 +107,7 @@ func (self *Readline) get_screen_lines() []*ScreenLine {
|
|||||||
cursor_at_start_of_next_line = false
|
cursor_at_start_of_next_line = false
|
||||||
sl.CursorCell = prompt.Length
|
sl.CursorCell = prompt.Length
|
||||||
sl.CursorTextPos = 0
|
sl.CursorTextPos = 0
|
||||||
|
found_cursor = true
|
||||||
}
|
}
|
||||||
ans = append(ans, &sl)
|
ans = append(ans, &sl)
|
||||||
if has_cursor && !found_cursor && offset <= cursor.X && cursor.X <= offset+len(l) {
|
if has_cursor && !found_cursor && offset <= cursor.X && cursor.X <= offset+len(l) {
|
||||||
@@ -198,6 +199,7 @@ func (self *Readline) redraw() {
|
|||||||
self.loop.QueueWriteString("\r")
|
self.loop.QueueWriteString("\r")
|
||||||
self.loop.MoveCursorHorizontally(cursor_x)
|
self.loop.MoveCursorHorizontally(cursor_x)
|
||||||
self.cursor_y = 0
|
self.cursor_y = 0
|
||||||
|
cursor_y -= move_cursor_up_by
|
||||||
if cursor_y > 0 {
|
if cursor_y > 0 {
|
||||||
self.cursor_y = cursor_y - 1
|
self.cursor_y = cursor_y - 1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user