branch: elpa/idris-mode
commit 88e08a2f10d2fdaa982249df61554219d0776968
Author: Marek L <[email protected]>
Commit: Marek L <[email protected]>

    Mark idris file buffer loaded when loaded synchronously only
    
    in the context of execution of the `idris-load-file-sync`.
    
    Why:
    Only time it should be marked as loaded globally is when
    user uses explicitly `idris-load-file` because
    otherwise it messes state of highlighting and ability
    to trigger (re)load.
---
 idris-commands.el | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/idris-commands.el b/idris-commands.el
index 5c9697a42e..3c824e305b 100644
--- a/idris-commands.el
+++ b/idris-commands.el
@@ -269,16 +269,15 @@ This sets the load position to point, if there is one."
                (idris-semantic-source-highlighting
                 (and 
idris-x-enable-semantic-source-highlighting-in-sync-file-load
                      (idris-buffer-semantic-source-highlighting))))
-          (setq idris-currently-loaded-buffer nil)
           (idris-switch-working-directory srcdir)
           (idris-toggle-semantic-source-highlighting)
           (let ((result
                  (idris-eval
                   (if idris-load-to-here
                       `(:load-file ,fn ,(idris-get-line-num 
idris-load-to-here))
-                    `(:load-file ,fn)))))
+                    `(:load-file ,fn))))
+                (idris-currently-loaded-buffer (current-buffer)))
             (idris-update-options-cache)
-            (setq idris-currently-loaded-buffer (current-buffer))
             (idris-make-clean)
             (idris-update-loaded-region (car result)))))
     (user-error "Cannot find file for current buffer")))

Reply via email to