disable buggy cursor move in windows
This commit is contained in:
parent
8689d712a3
commit
a99601668a
11
ui.go
11
ui.go
@ -9,6 +9,7 @@ import (
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
@ -497,6 +498,14 @@ func (ui *ui) loadFile(nav *nav) {
|
||||
}
|
||||
}
|
||||
|
||||
func moveCursor(y, x int) {
|
||||
// TODO: implement for windows
|
||||
if runtime.GOOS == "windows" {
|
||||
return
|
||||
}
|
||||
fmt.Printf("\033[%d;%dH", y, x)
|
||||
}
|
||||
|
||||
func (ui *ui) draw(nav *nav) {
|
||||
fg, bg := termbox.ColorDefault, termbox.ColorDefault
|
||||
|
||||
@ -566,7 +575,7 @@ func (ui *ui) draw(nav *nav) {
|
||||
|
||||
if ui.cmdpref == "" {
|
||||
// leave the cursor at the beginning of the current file for screen readers
|
||||
fmt.Printf("\033[%d;%dH", ui.wins[woff+length-1].y+nav.dirs[doff+length-1].pos+1, ui.wins[woff+length-1].x+1)
|
||||
moveCursor(ui.wins[woff+length-1].y+nav.dirs[doff+length-1].pos+1, ui.wins[woff+length-1].x+1)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user