Skip to content

Commit e19b700

Browse files
authored
gptel-rewrite: Make other modes not clobber rewrite overlay (#744)
When rewriting sections of Lisp or other code where the initial character is a parenthesis, it results in `show-paren-mode' highlighting the entire overlay when the point is positioned within the overlay area. Other modes like `hl-line-mode' cause similar issues. Avoid this by using a very high priority for `gptel-rewrite-highlight-face'. (#691) * gptel-rewrite.el (gptel-rewrite-highlight-face): Inherit from the `default' face to avoid foreground being the same as `show-paren-match', which is usually a reverse color. (gptel--rewrite-callback): Use priority 2000.
1 parent f79c9d0 commit e19b700

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gptel-rewrite.el

+3-2
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ overlay."
8787

8888
(defface gptel-rewrite-highlight-face
8989
'((((class color) (min-colors 88) (background dark))
90-
:background "#041714" :extend t)
90+
:background "#041714" :extend t :inherit default)
9191
(((class color) (min-colors 88) (background light))
92-
:background "light goldenrod yellow" :extend t)
92+
:background "light goldenrod yellow" :extend t :inherit default)
9393
(t :inherit secondary-selection))
9494
"Face for highlighting regions with pending rewrites."
9595
:group 'gptel)
@@ -434,6 +434,7 @@ INFO is the async communication channel for the rewrite request."
434434
(add-hook 'eldoc-documentation-functions #'gptel--rewrite-key-help nil 'local)
435435
;; (overlay-put ov 'gptel-rewrite response)
436436
(overlay-put ov 'face 'gptel-rewrite-highlight-face)
437+
(overlay-put ov 'priority 2000)
437438
(overlay-put ov 'keymap gptel-rewrite-actions-map)
438439
(overlay-put ov 'mouse-face 'highlight)
439440
(overlay-put

0 commit comments

Comments
 (0)