* src/fns.c (Fline_number_at_pos): Get the correct start position
in non-ASCII buffers (bug#22763).
from the absolute start of the buffer. */)
(register Lisp_Object position, Lisp_Object absolute)
{
- ptrdiff_t pos, start = BEGV;
+ ptrdiff_t pos, start = BEGV_BYTE;
if (MARKERP (position))
pos = marker_position (position);
(insert (propertize "\nbar\nbaz\nzut" 'invisible t))
(should (= (count-lines (point-min) (point-max) t) 2))))
+(ert-deftest simple-text-count-lines-non-ascii ()
+ (with-temp-buffer
+ (insert "あ\nい\nう\nえ\nお\n")
+ (should (= (count-lines (point) (point)) 0))))
+
\f
;;; `transpose-sexps'
(defmacro simple-test--transpositions (&rest body)