Closed Dr-Dd closed 4 years ago
With line numbers disabled the function returns 0.
The function is only available from emacs 26 onward, since display-line-numbers-mode
got introduced with the same release. I followed company--posn-col-row
example as suggested to preserve backwards compat.
Add
;; To avoid warnings in Emacs < 26.
(declare-function line-number-display-width "indent.c")
and we're good to go.
Thanks!
Added offset determined by the presence (or absence) of line-numbers. The errand 2 is the number of columns that line numbers occupy including the current line-number width, as in
█nnn█
. The two ascii blocks are the two extra columns, for a total of 3+2=5 width.This fixes #96