idris-hackers / idris-mode

Idris syntax highlighting, compiler-supported editing, interactive REPL and more things for Emacs.
GNU General Public License v3.0
267 stars 70 forks source link

Remove conditional for srcdir in `idris-load-file` used to switch work directory for Idris2 #580

Closed keram closed 1 year ago

keram commented 1 year ago

Why: The conditional needed is already present in idris-switch-working-directory and this fixes issue of unable to load files into Idris2 in different directories.

Steps to reproduce: Given directory "a" with file foo.idr and directory "b" with bar.idr Then open a/foo.idr and load the file to Idris2 (M-x idris-load-file) Then open b/bar.idr and try load it to Idris2.

Current result: Evaluation returned an error: Error loading file bar.idr: File Not Found. Expected: bar.idr loaded to Idris2 and working directory switched to "b".

This change also aligns idris-load-file and idris-load-file-sync where the conditional was not included in past.

Also includes improvements to idris-switch-working-directory