mirror of
https://github.com/EnumeratedDev/Typer.git
synced 2025-07-01 07:48:20 +00:00
Change buffer cursor rendering method
This commit is contained in:
parent
8ef682e8bf
commit
ab58ef1282
@ -108,6 +108,19 @@ func (window *Window) drawCurrentBuffer() {
|
||||
x++
|
||||
}
|
||||
}
|
||||
|
||||
// Draw cursor
|
||||
cursorX, cursorY := window.GetCursorPos2D()
|
||||
|
||||
if window.ShowTopMenu {
|
||||
cursorY++
|
||||
}
|
||||
if window.ShowLineIndex {
|
||||
cursorX += 3
|
||||
}
|
||||
|
||||
r, _, _, _ := window.screen.GetContent(cursorX, cursorY)
|
||||
window.screen.SetContent(cursorX, cursorY, r, nil, selectedStyle)
|
||||
}
|
||||
|
||||
func (window *Window) Draw() {
|
||||
@ -141,9 +154,7 @@ func (window *Window) Draw() {
|
||||
drawDropdowns(window)
|
||||
|
||||
// Draw cursor
|
||||
if window.CursorMode == CursorModeBuffer {
|
||||
window.screen.ShowCursor(window.GetAbsoluteCursorPos())
|
||||
} else if window.CursorMode == CursorModeInputBar {
|
||||
if window.CursorMode == CursorModeInputBar {
|
||||
_, sizeY := window.screen.Size()
|
||||
window.screen.ShowCursor(len(currentInputRequest.Text)+len(currentInputRequest.input)+1, sizeY-1)
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user