Permalink
Browse files

Don't look beyond (point-max) when expanding current word eagerly

  • Loading branch information...
1 parent eec2dc7 commit 5580dccee97b19fc5733fb09aa0e7c826b13bcee @purcell committed Jul 14, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 auto-complete.el
View
@@ -1102,7 +1102,7 @@ that have been made before in this function."
(when (not (equal string (buffer-substring ac-point (point))))
;; If string already begins at ac-point, but (point) is not at its end, replace the entire
;; common part
- (let* ((common (try-completion "" (list string (buffer-substring ac-point (+ ac-point (length string))))))
+ (let* ((common (try-completion "" (list string (buffer-substring ac-point (min (point-max) (+ ac-point (length string)))))))
(replace-up-to (max (point) (+ ac-point (length common)))))
(undo-boundary)
;; We can't use primitive-undo since it undoes by

0 comments on commit 5580dcc

Please sign in to comment.