Skip to content

Commit 625bf71

Browse files
committed
Fix history chat index
1 parent 36aa793 commit 625bf71

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

eca-chat.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ This is similar to `backward-delete-char' but protects the prompt/context line."
270270
(unless (string-empty-p prompt)
271271
(when (seq-empty-p eca-chat--history) (eca-chat--clear))
272272
(add-to-list 'eca-chat--history prompt)
273-
(setq eca-chat--history-index 0)
273+
(setq eca-chat--history-index -1)
274274
(goto-char prompt-start)
275275
(delete-region (point) (point-max))
276276
(eca-api-request-async
@@ -455,7 +455,7 @@ This is similar to `backward-delete-char' but protects the prompt/context line."
455455
(visual-line-mode)
456456
(hl-line-mode -1)
457457
(setq-local eca-chat--history '())
458-
(setq-local eca-chat--history-index 0)
458+
(setq-local eca-chat--history-index -1)
459459

460460
(make-local-variable 'completion-at-point-functions)
461461
(setq-local completion-at-point-functions (list #'eca-chat-completion-at-point))

0 commit comments

Comments
 (0)