branch: elpa/idris-mode
commit 928f785bb70ccb4c7c48da4a5bc064df7f21f775
Author: Marek L <[email protected]>
Commit: Marek L <[email protected]>
Remove conditional for srcdir in `idris-load-file` used to switch work
directory
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".
---
idris-commands.el | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/idris-commands.el b/idris-commands.el
index 9b8eb7ee32..75b9a05433 100644
--- a/idris-commands.el
+++ b/idris-commands.el
@@ -214,13 +214,7 @@ A prefix argument forces loading but only up to the
current line."
;; Actually do the loading
(let* ((dir-and-fn (idris-filename-to-load))
(fn (cdr dir-and-fn))
- (srcdir
- (if (> idris-protocol-version 1)
- (prin1-to-string (car dir-and-fn))
- (car dir-and-fn)
- )
- )
- )
+ (srcdir (car dir-and-fn)))
(setq idris-currently-loaded-buffer nil)
(idris-switch-working-directory srcdir)
(idris-delete-ibc t) ;; delete the ibc to avoid interfering with
partial loads