aboutsummaryrefslogtreecommitdiff
path: root/gptel-tools/read_buffer.el
diff options
context:
space:
mode:
Diffstat (limited to 'gptel-tools/read_buffer.el')
-rw-r--r--gptel-tools/read_buffer.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/gptel-tools/read_buffer.el b/gptel-tools/read_buffer.el
index 1b4fc904..c9136e3c 100644
--- a/gptel-tools/read_buffer.el
+++ b/gptel-tools/read_buffer.el
@@ -14,7 +14,9 @@ error when no live buffer matches."
(unless (buffer-live-p (get-buffer buffer))
(error "Buffer %s is not live" buffer))
(with-current-buffer buffer
- (buffer-substring-no-properties (point-min) (point-max))))
+ (save-restriction
+ (widen)
+ (buffer-substring-no-properties (point-min) (point-max)))))
(gptel-make-tool
:name "read_buffer"