From 02940bc930687c8b0705148b3058ba0c46aa68dc Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Tue, 9 Sep 2014 04:01:42 +0400 Subject: [PATCH] Use posn-actual-col-row to calculate the row Approximation by `posn-col-row' is not good enough, particularly in the Log-Edit buffer. --- company.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/company.el b/company.el index 17c881522..f9f4b7492 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 "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) -- 2.39.2