Skip to content

Commit 6476af1

Browse files
committed
Allow eca run on non file buffers
1 parent 721e59b commit 6476af1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

eca-chat.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,8 @@ This is similar to `backward-delete-char' but protects the prompt/context line."
548548
(eca-chat-mode))
549549
(unless (eca--session-chat eca--session)
550550
(setf (eca--session-chat eca--session) (current-buffer)))
551-
(eca-chat--add-context "file" (buffer-file-name source-buffer))
551+
(when-let* ((file-name (buffer-file-name source-buffer)))
552+
(eca-chat--add-context "file" file-name))
552553
(if (window-live-p (get-buffer-window (buffer-name)))
553554
(eca-chat--select-window)
554555
(eca-chat--pop-window)))))

0 commit comments

Comments
 (0)