branch: elpa/gptel commit e19b700a89ed3120b5785b58f95ab738fb50230e Author: Henrik Ahlgren <pa...@seestieto.com> Commit: GitHub <nore...@github.com>
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. --- gptel-rewrite.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gptel-rewrite.el b/gptel-rewrite.el index e66b15f0ce..68fd8fa7a2 100644 --- a/gptel-rewrite.el +++ b/gptel-rewrite.el @@ -87,9 +87,9 @@ overlay." (defface gptel-rewrite-highlight-face '((((class color) (min-colors 88) (background dark)) - :background "#041714" :extend t) + :background "#041714" :extend t :inherit default) (((class color) (min-colors 88) (background light)) - :background "light goldenrod yellow" :extend t) + :background "light goldenrod yellow" :extend t :inherit default) (t :inherit secondary-selection)) "Face for highlighting regions with pending rewrites." :group 'gptel) @@ -434,6 +434,7 @@ INFO is the async communication channel for the rewrite request." (add-hook 'eldoc-documentation-functions #'gptel--rewrite-key-help nil 'local) ;; (overlay-put ov 'gptel-rewrite response) (overlay-put ov 'face 'gptel-rewrite-highlight-face) + (overlay-put ov 'priority 2000) (overlay-put ov 'keymap gptel-rewrite-actions-map) (overlay-put ov 'mouse-face 'highlight) (overlay-put