katspaugh / ido-at-point

ido-at-point
51 stars 4 forks source link

`ido-at-point` leaves behind face properties from the ido buffer #9

Closed david-christiansen closed 10 years ago

david-christiansen commented 10 years ago

I was trying to use ido-at-point for completion in Idris's REPL, and I noticed that some letters had extra fonts - they were the wrong color.

The following redefinition makes the problem go away:

(defun ido-at-point-insert (start end common-part-length completion)
  "Replaces text in buffer from END back to COMMON-PART-LENGTH
with COMPLETION."
  (let ((reg-start (- end common-part-length)))
    (goto-char end)
    (delete-region (max start reg-start) end)
    (set-text-properties 0 (length completion) nil completion)
    (insert completion)))
katspaugh commented 10 years ago

Hi David,

I've added substring-no-properties in the insert function. Could you check if it works for you?

david-christiansen commented 10 years ago

Sorry for the slow reply - I missed the notification somehow.

It works just fine that way. Thanks!