From: Dmitry Gutov Date: Mon, 22 Sep 2014 03:10:10 +0000 (+0400) Subject: company--insert-candidate: Don't use `insert-before-markers' X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/202e61de0b73c8ff0a3817b25cddc67914ad2bc2 company--insert-candidate: Don't use `insert-before-markers' Fixes #189. Apparently, it's enough to pass t REAR-ADVANCE agrument to `make-overlay' when creating the pseudo-tooltip overlay. --- diff --git a/company.el b/company.el index c47c72e4b..15a6eeed6 100644 --- a/company.el +++ b/company.el @@ -978,7 +978,7 @@ Controlled by `company-auto-complete'.") (if (eq (company-call-backend 'ignore-case) 'keep-prefix) (insert (company-strip-prefix candidate)) (delete-region (- (point) (length company-prefix)) (point)) - (insert-before-markers candidate))) + (insert candidate))) (defmacro company-with-candidate-inserted (candidate &rest body) "Evaluate BODY with CANDIDATE temporarily inserted. @@ -2388,7 +2388,7 @@ Returns a negative number if the tooltip should be displayed above point." (end (save-excursion (move-to-window-line (+ row (abs height))) (point))) - (ov (make-overlay (if nl beg (1- beg)) end nil t)) + (ov (make-overlay (if nl beg (1- beg)) end nil t t)) (args (list (mapcar 'company-plainify (company-buffer-lines beg end)) column nl above)))