Skip to content

Commit 9aaa78a

Browse files
committed
Minor fix in thoughts in subagents blocks
1 parent c698ad9 commit 9aaa78a

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

eca-chat.el

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,8 @@ NESTED-PROPS is a plist with :parent-id and :label-indent for nested blocks."
13261326
(eca-chat--insert (propertize (eca-chat--propertize-only-first-word label
13271327
'line-prefix (cond
13281328
((not (string-empty-p content)) open-icon)
1329-
(label-indent label-indent)))
1329+
(label-indent (concat label-indent
1330+
(make-string (length eca-chat-expandable-block-open-symbol) ?\s)))))
13301331
'keymap (let ((km (make-sparse-keymap)))
13311332
(define-key km (kbd "<mouse-1>") (lambda () (interactive) (eca-chat--expandable-content-toggle id)))
13321333
(define-key km (kbd "<tab>") (lambda () (interactive) (eca-chat--expandable-content-toggle id)))
@@ -1454,12 +1455,20 @@ in parent."
14541455
(overlay-put ov-label 'eca-chat--expandable-content-close-icon (cdr new-icons)))
14551456
(goto-char (overlay-start ov-label))
14561457
(delete-region (point) (1- (overlay-start ov-content)))
1457-
(eca-chat--insert (propertize (eca-chat--propertize-only-first-word label
1458-
'line-prefix (unless (string-empty-p new-content)
1459-
(if open?
1460-
(overlay-get ov-label 'eca-chat--expandable-content-close-icon)
1461-
(overlay-get ov-label 'eca-chat--expandable-content-open-icon))))
1462-
'help-echo "mouse-1 / RET / tab: expand/collapse"))
1458+
(let* ((children (eca-chat--segments-children
1459+
(overlay-get ov-label 'eca-chat--expandable-content-segments)))
1460+
(has-content? (or (not (string-empty-p new-content)) children))
1461+
(label-prefix (cond
1462+
(has-content?
1463+
(if open?
1464+
(overlay-get ov-label 'eca-chat--expandable-content-close-icon)
1465+
(overlay-get ov-label 'eca-chat--expandable-content-open-icon)))
1466+
(nested?
1467+
(concat eca-chat--expandable-content-base-indent
1468+
(make-string (length eca-chat-expandable-block-open-symbol) ?\s))))))
1469+
(eca-chat--insert (propertize (eca-chat--propertize-only-first-word label
1470+
'line-prefix label-prefix)
1471+
'help-echo "mouse-1 / RET / tab: expand/collapse")))
14631472
;; Repaint nested label's line-prefix after label replacement
14641473
(eca-chat--paint-nested-label ov-label))
14651474
(when open?

0 commit comments

Comments
 (0)