Skip to content

Commit 01e8970

Browse files
committed
Fix context query
1 parent 33f4367 commit 01e8970

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

eca-chat.el

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,10 +1268,10 @@ restore the chat display after smerge quits."
12681268
"Return the text typed after the last context prefix on the context line.
12691269
For example: `@foo @bar @baz` => `baz`. If nothing is typed, returns an empty
12701270
string."
1271-
(let ((prompt-area (eca-chat--prompt-area-start-point))
1271+
(let ((context-area (eca-chat--new-context-start-point))
12721272
(prefix eca-chat-context-prefix))
12731273
(save-excursion
1274-
(goto-char prompt-area)
1274+
(goto-char context-area)
12751275
(end-of-line)
12761276
(let* ((line-start (line-beginning-position))
12771277
(line-end (point))
@@ -1306,14 +1306,12 @@ string."
13061306
('contexts
13071307
(let ((query (eca-chat--context-find-typed-query)))
13081308
(or (gethash query eca-chat--context-completion-cache)
1309-
(-let* (((&plist :contexts contexts) (progn
1310-
(message "--> requesting contexts %s" query)
1311-
(eca-api-request-while-no-input
1312-
(eca-session)
1313-
:method "chat/queryContext"
1314-
:params (list :chatId eca-chat--id
1315-
:query query
1316-
:contexts (vconcat eca-chat--context)))))
1309+
(-let* (((&plist :contexts contexts) (eca-api-request-while-no-input
1310+
(eca-session)
1311+
:method "chat/queryContext"
1312+
:params (list :chatId eca-chat--id
1313+
:query query
1314+
:contexts (vconcat eca-chat--context))))
13171315
(items (-map #'eca-chat--context-to-completion contexts)))
13181316
(setq-local eca-chat--context-completion-cache (make-hash-table :test 'equal))
13191317
(puthash query items eca-chat--context-completion-cache)

0 commit comments

Comments
 (0)