[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] 07/14: Use posn-actual-col-row to calculate the row

From: Dmitry Gutov
Subject: [elpa] 07/14: Use posn-actual-col-row to calculate the row
Date: Sat, 13 Sep 2014 12:19:01 +0000

dgutov pushed a commit to branch master
in repository elpa.

commit 02940bc930687c8b0705148b3058ba0c46aa68dc
Author: Dmitry Gutov <address@hidden>
Date:   Tue Sep 9 04:01:42 2014 +0400

    Use posn-actual-col-row to calculate the row
    Approximation by `posn-col-row' is not good enough, particularly in the 
 company.el |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/company.el b/company.el
index 17c8815..f9f4b74 100644
--- a/company.el
+++ b/company.el
@@ -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 ""))
+(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 ""))
       ;; http://debbugs.gnu.org/18384
-      (cl-incf row))
+      (cl-decf row))
     (cons (+ col (window-hscroll)) row)))
 (defun company--col-row (&optional pos)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]