Skip to content

Commit fd44367

Browse files
authored
Merge pull request #74 from Artawower/multiline-prompt-history
Support multiline prompts in history navigation
2 parents 653e97e + bbc72a8 commit fd44367

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

eca-chat.el

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ Otherwise to a not loading state."
617617
(defun eca-chat--set-prompt (text)
618618
"Set the chat prompt to be TEXT."
619619
(-some-> (eca-chat--prompt-field-start-point) (goto-char))
620-
(delete-region (point) (line-end-position))
620+
(delete-region (point) (point-max))
621621
(insert text))
622622

623623
(defun eca-chat--cycle-history (n)
@@ -834,8 +834,9 @@ the prompt/context line."
834834

835835
(defun eca-chat--point-at-prompt-field-p ()
836836
"Return non-nil if point is at the prompt field area."
837-
(eq (line-number-at-pos (point))
838-
(line-number-at-pos (eca-chat--prompt-field-start-point))))
837+
(let ((prompt-start (eca-chat--prompt-field-start-point)))
838+
(and prompt-start
839+
(>= (point) prompt-start))))
839840

840841
(defun eca-chat--header-line-string (session)
841842
"Update chat header line for SESSION."

0 commit comments

Comments
 (0)