Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ always go to Evil modes if you need to with ~C-z~).
| agent-shell-qwen-acp-command | Command and parameters for the Qwen Code client. |
| agent-shell-qwen-authentication | Configuration for Qwen Code authentication. |
| agent-shell-qwen-environment | Environment variables for the Qwen Code client. |
| agent-shell-region-context-max-lines | Limit region context to this many lines |
| agent-shell-screenshot-command | The program to use for capturing screenshots. |
| agent-shell-section-functions | Abnormal hook run after overlays are applied (experimental). |
| agent-shell-session-strategy | How to handle sessions when starting a new shell. |
Expand Down
10 changes: 7 additions & 3 deletions agent-shell.el
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,11 @@ passed through to `acp-make-client'."
(map-elt (buffer-local-value 'agent-shell--state context-buffer)
:outgoing-request-decorator)))))

(defcustom agent-shell-region-context-max-lines nil
"Limit region context to at most this many lines if non-nil."
:type '(choice (const nil) integer)
:group 'agent-shell)

(defcustom agent-shell-text-file-capabilities t
"Whether agents are initialized with read/write text file capabilities.

Expand Down Expand Up @@ -5736,8 +5741,7 @@ Uses AGENT-CWD to shorten file paths where necessary."
(numbered-preview
(when-let ((buffer (get-file-buffer (map-elt region :file))))
(let ((char-start (map-elt region :char-start))
(char-end (map-elt region :char-end))
(max-preview-lines 5))
(char-end (map-elt region :char-end)))
(if (equal (line-number-at-pos char-start)
(line-number-at-pos char-end))
;; Same line region? Avoid numbering.
Expand All @@ -5746,7 +5750,7 @@ Uses AGENT-CWD to shorten file paths where necessary."
:buffer buffer
:from char-start
:to char-end
:cap max-preview-lines))))))
:cap agent-shell-region-context-max-lines))))))
(if numbered-preview
(concat file-link "\n\n" numbered-preview)
file-link))
Expand Down