the -s switch was sorting the @window, thus the files listed in the @window were not in order by way they were found...
so i would have like 3 files in the main folder, then another folder, then 6 more file in the main again, then another folder, then more files in main, etc, and samething within the subdirs, i guess you could say it "works", but not totaly what i was looking for, something like this, if possible:

you have the main folder, then it lists all the first layer folder within, then it lists all the files in order within the main folder, then if you open one of the subfolder, it has the same type of list,(all the folsder within that folder, then all the file within that folder)

know what i mean?

but i do have to say, that it is closer to what i want with the -s swicth, lol.....Also a little error i think you made, was in this part:

if $isdir(%line) {
did -a switchbar 2 +b $gettok(%line,-1,92)
;%nopath
if %line isin $line(@f,$calc(%i + 1)) {
did -i switchbar 2 1 cb last
}
}
else {
did -a switchbar 2 4 %nopath
}


see the first part, you had %nopath, and then the same for the else, once i changed that it was workin better, cept for the part i mentioned above about the way it lists them...