If the working directory saved by AsciidocFX is not a path to a valid directory or subdirectory, changing the working directory becomes impossible from the GUI (clicking the button to set the working directory fails to open a prompt).
Fix
With this PR, the first valid parent directory found is used to browse and if none exists we use the first drive found.
Test
All tests were performed on windows, all commands executed in cmd
Test path bubble-up
Create a custom workdir under several subdirectories : mkdir my/custom/workdir/for/tests
Start AsciidocFX and set the workdir to my/custom/workdir/for/tests
Delete the whole directory tree rm -r my (real use-case requires to close AsciidocFX first and restart it after)
Try to change the working directory by pressing the icon
Test Drive failover
Create a custom workdir drive subst K: %cd%
Start AsciidocFX and set the workdir to K:\
Delete the whole directory tree subst /D K: (real use-case requires to close AsciidocFX first and restart it after)
Ttry to change the working directory by pressing the icon
Issue
Fix #514
If the working directory saved by AsciidocFX is not a path to a valid directory or subdirectory, changing the working directory becomes impossible from the GUI (clicking the button to set the working directory fails to open a prompt).
Fix
With this PR, the first valid parent directory found is used to browse and if none exists we use the first drive found.
Test
All tests were performed on windows, all commands executed in cmd
Test path bubble-up
mkdir my/custom/workdir/for/tests
my/custom/workdir/for/tests
rm -r my
(real use-case requires to close AsciidocFX first and restart it after)Test Drive failover
subst K: %cd%
K:\
subst /D K:
(real use-case requires to close AsciidocFX first and restart it after)