mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-10 06:54:04 +09:00
zfm: fix: navigation was broken with TVDOSFileDescriptor change
This commit is contained in:
@@ -70,7 +70,9 @@ let filesPanelDraw = (wo) => {
|
|||||||
let usedBytes = undefined
|
let usedBytes = undefined
|
||||||
let totalBytes = undefined
|
let totalBytes = undefined
|
||||||
let freeBytes = undefined
|
let freeBytes = undefined
|
||||||
let pathStr = path[windowMode].concat(['']).join("\\")
|
let pathStr = path[windowMode].concat(['']).join("\\").replaceAll('\\\\', '\\')
|
||||||
|
|
||||||
|
// serial.println(`pathStr=${pathStr}`)
|
||||||
|
|
||||||
let port = _TVDOS.DRIVES[pathStr[0]]
|
let port = _TVDOS.DRIVES[pathStr[0]]
|
||||||
|
|
||||||
@@ -105,6 +107,7 @@ let filesPanelDraw = (wo) => {
|
|||||||
// draw list
|
// draw list
|
||||||
let fileList = []
|
let fileList = []
|
||||||
if (!showDrives) {
|
if (!showDrives) {
|
||||||
|
// serial.println(`pathStr=${pathStr}`)
|
||||||
fileList = files.open(pathStr).list()
|
fileList = files.open(pathStr).list()
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -113,7 +116,9 @@ let filesPanelDraw = (wo) => {
|
|||||||
let dinfo = _TVDOS.DRIVEINFO[letter]
|
let dinfo = _TVDOS.DRIVEINFO[letter]
|
||||||
|
|
||||||
if (dinfo.type == "STOR") {
|
if (dinfo.type == "STOR") {
|
||||||
fileList.push(files.open(`${letter}:\\`))
|
let file = files.open(`${letter}:\\`)
|
||||||
|
fileList.push(file)
|
||||||
|
// serial.println(`fileList ${file.fullPath}`)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -325,12 +330,15 @@ let filenavOninput = (window, event) => {
|
|||||||
else if (keyJustHit && keycode == 66) { // enter
|
else if (keyJustHit && keycode == 66) { // enter
|
||||||
let selectedFile = dirFileList[windowMode][cursor[windowMode]]
|
let selectedFile = dirFileList[windowMode][cursor[windowMode]]
|
||||||
|
|
||||||
if (selectedFile.fullPath.length == 2) {
|
// serial.println(`selectedFile = ${selectedFile.fullPath}`)
|
||||||
|
|
||||||
|
if (selectedFile.fullPath[1] == ":" && selectedFile.fullPath[2] == "\\" && selectedFile.fullPath.length == 3) {
|
||||||
path[windowMode].push(selectedFile.fullPath)
|
path[windowMode].push(selectedFile.fullPath)
|
||||||
cursor[windowMode] = 0; scroll[windowMode] = 0
|
cursor[windowMode] = 0; scroll[windowMode] = 0
|
||||||
drawFilePanel()
|
drawFilePanel()
|
||||||
}
|
}
|
||||||
else if (selectedFile.isDirectory) {
|
else if (selectedFile.isDirectory) {
|
||||||
|
// serial.println(`selectedFile.name = ${selectedFile.name}`)
|
||||||
path[windowMode].push(selectedFile.name)
|
path[windowMode].push(selectedFile.name)
|
||||||
cursor[windowMode] = 0; scroll[windowMode] = 0
|
cursor[windowMode] = 0; scroll[windowMode] = 0
|
||||||
drawFilePanel()
|
drawFilePanel()
|
||||||
@@ -342,15 +350,15 @@ let filenavOninput = (window, event) => {
|
|||||||
|
|
||||||
con.curs_set(1);clearScr();con.move(1,1)
|
con.curs_set(1);clearScr();con.move(1,1)
|
||||||
try {
|
try {
|
||||||
// serial.println(selectedFile.fullPath)
|
// // serial.println(selectedFile.fullPath)
|
||||||
errorlevel = execfun(selectedFile.fullPath)
|
errorlevel = execfun(selectedFile.fullPath)
|
||||||
// serial.println("1 errorlevel = " + errorlevel)
|
// // serial.println("1 errorlevel = " + errorlevel)
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
// TODO popup error
|
// TODO popup error
|
||||||
println(e)
|
println(e)
|
||||||
errorlevel = 1
|
errorlevel = 1
|
||||||
// serial.println("2 errorlevel = " + errorlevel)
|
// // serial.println("2 errorlevel = " + errorlevel)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (errorlevel) {
|
if (errorlevel) {
|
||||||
|
|||||||
Reference in New Issue
Block a user