Skip to content

Commit 0da1d40

Browse files
authored
Merge pull request #55 from dellison/julia-repl-cd
have julia-repl-cd also set default-directory
2 parents 54b4aa3 + df8757f commit 0da1d40

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

julia-repl.el

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,10 @@ this with a prefix argument ARG."
520520
(defun julia-repl-cd ()
521521
"Change directory to the directory of the current buffer (if applicable)."
522522
(interactive)
523-
(if-let ((filename (buffer-file-name)))
524-
(julia-repl--send-string (concat "cd(\"" (file-name-directory filename) "\")"))
523+
(if-let ((directory (file-name-directory (buffer-file-name))))
524+
(progn
525+
(julia-repl--send-string (concat "cd(\"" directory "\")"))
526+
(with-current-buffer (julia-repl-inferior-buffer) (cd directory)))
525527
(warn "buffer not associated with a file")))
526528

527529
(defun julia-repl-activate-parent (arg)

0 commit comments

Comments
 (0)