Skip to content

Commit b83fbcd

Browse files
committed
gptel-context: Reverse hunks with accidentally changed indentation
1 parent 4b99e1e commit b83fbcd

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

gptel-context.el

+11-11
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ listed in `.gitignore' in a Git repository) will not be added to the context."
119119
;; A region is selected.
120120
((use-region-p)
121121
(gptel-context--add-region (current-buffer)
122-
(region-beginning)
123-
(region-end))
122+
(region-beginning)
123+
(region-end))
124124
(deactivate-mark)
125125
(message "Current region added as context."))
126126
;; If in dired
@@ -145,9 +145,9 @@ listed in `.gitignore' in a Git repository) will not be added to the context."
145145
(not (gptel-context--skip-p (buffer-file-name))))
146146
(gptel-context--ensure-project-files default-directory)
147147
(funcall (if (and arg (< (prefix-numeric-value arg) 0))
148-
#'gptel-context-remove
149-
#'gptel-context-add-file)
150-
(buffer-file-name)))
148+
#'gptel-context-remove
149+
#'gptel-context-add-file)
150+
(buffer-file-name)))
151151
;; No region is selected, and ARG is positive.
152152
((and arg (> (prefix-numeric-value arg) 0))
153153
(let* ((buffer-name (read-buffer "Choose buffer to add as context: "
@@ -162,17 +162,17 @@ listed in `.gitignore' in a Git repository) will not be added to the context."
162162
(when (or (null confirm)
163163
(y-or-n-p "Remove all contexts from this buffer? "))
164164
(let ((removed-contexts 0))
165-
(cl-loop for cov in
165+
(cl-loop for cov in
166166
(gptel-context--in-region (current-buffer) (point-min) (point-max))
167167
do (progn
168168
(cl-incf removed-contexts)
169169
(gptel-context-remove cov)))
170-
(message (format "%d context%s removed from current buffer."
170+
(message (format "%d context%s removed from current buffer."
171171
removed-contexts
172172
(if (= removed-contexts 1) "" "s"))))))
173173
(t ; Default behavior
174174
(if (gptel-context--at-point)
175-
(progn
175+
(progn
176176
(gptel-context-remove (car (gptel-context--in-region (current-buffer)
177177
(max (point-min) (1- (point)))
178178
(point))))
@@ -251,7 +251,7 @@ be readable as text."
251251
(gptel-context--skip-p path)))
252252
(gptel-context--message-skipped path))
253253
((gptel--file-binary-p path)
254-
(gptel-context--add-binary-file path))
254+
(gptel-context--add-binary-file path))
255255
(t (gptel-context--add-text-file path))))
256256

257257
;;;###autoload (autoload 'gptel-add-file "gptel-context" "Add files to gptel's context." t)
@@ -318,8 +318,8 @@ If CONTEXT is a directory, recursively removes all files in it."
318318
(message "File \"%s\" removed from context." context)))
319319
((region-active-p)
320320
(when-let* ((contexts (gptel-context--in-region (current-buffer)
321-
(region-beginning)
322-
(region-end))))
321+
(region-beginning)
322+
(region-end))))
323323
(cl-loop for ctx in contexts do (delete-overlay ctx))))
324324
(t
325325
(when-let* ((ctx (gptel-context--at-point)))

0 commit comments

Comments
 (0)