Commits

camlspotter committed 88b3a05

count-lines fix

  • Participants
  • Parent commits 0521bed
  • Branches ocamlspot

Comments (0)

Files changed (1)

ocamlspot/ocamlspot.el

    (encode-coding-string
     (ocamlspot-string-of-line-to-point) buffer-file-coding-system)))
 
+; It count one line less when the cursor is at (point-max) 
+; and it is at the top of the line.
 (defun ocamlspot-lines-of-point ()
-  (count-lines (point-min) (point)))
+  (count-lines (point-min) (min (1+ (point)) (point-max))))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; column bytes => column chars