Closed cptpiepmatz closed 2 years ago
I'm no good at reading the code, but can at least confirm the buggy behaviour. Before applying the PR:
Bitburner v2.1.0 (8f4636cb)
[home ~/]> ls
dirB/
hackers-starting-handbook.lit
NUKE.exe
scriptA.js
scriptB.js
[home ~/]> cd dirB/
[home ~/dirB]> ls
dirC/
scriptB.js
[home ~/dirB]> cd dirC/
[home ~/dirB/dirC]> ls
scriptA.js
scriptB.js
[home ~/dirB/dirC]>
scriptA.js
from /dirB/dirC/
opens the file /dirB/dirC/scriptA.js
.scriptA.js
from root /
opens /dirB/dirC/scriptA.js
, but the expected behaviour is to open the file /scriptA.js
.scriptB.js
from root /
opens the file /dirB/dirC/scriptB.js
, whereas the expected behaviour should be to open the file /scriptB.js
. If the file /dirB/dirC/scriptB.js
does not exist, then this action opens a non-existent file /dirB/dirC/scriptB.js
.scriptB.js
from /dirB
and it correctly opens the file /dirB/scriptB.js
.After applying the PR, the above test cases would open the expected file from the correct directory.
This PR fixes
nano
opening the incorrect file in the root directory if you cd'd into a directory.Expected Behavior
The script editor should open the correct file when you click on a file name of the root directory while having a directory currently opened/displayed.
Steps to reproduce
ls
command.cd
.ls
.Currently this opens a file in the current directory with the name of file in the root directory.
Checks made this works
I created multiple files in different and differently nested directories. I executed
ls
on all directories and opened all files from every selected directory. For me this seems to work now.