]> code.delx.au - gnu-emacs-elpa/commitdiff
Use posn-actual-col-row to calculate the row
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 9 Sep 2014 00:01:42 +0000 (04:01 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 9 Sep 2014 00:01:42 +0000 (04:01 +0400)
Approximation by `posn-col-row' is not good enough, particularly in the Log-Edit
buffer.

company.el

index 17c881522c1cbfed5368ca5cd7338ff999be4d30..f9f4b749254ced5b7dcaf52058cf27defabe3f42 100644 (file)
@@ -775,13 +775,12 @@ means that `company-mode' is always turned on except in `message-mode' buffers."
 (defun company-input-noop ()
   (push 31415926 unread-command-events))
 
-(defun company--posn-col-row (pos)
-  (let* ((col-row (posn-col-row pos))
-         (col (car col-row))
-         (row (cdr col-row)))
-    (when (and header-line-format (version< emacs-version "24.3.93.2"))
+(defun company--posn-col-row (posn)
+  (let ((col (car (posn-col-row posn)))
+        (row (cdr (posn-actual-col-row posn))))
+    (when (and header-line-format (version< emacs-version "24.3.93.3"))
       ;; http://debbugs.gnu.org/18384
-      (cl-incf row))
+      (cl-decf row))
     (cons (+ col (window-hscroll)) row)))
 
 (defun company--col-row (&optional pos)