Fix highlighting near beginning and end of buffer.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Wed, 21 Dec 2011 22:35:21 +0200
changeset 853 626114dd8100
parent 852 571e98c6d3c2
child 854 477a850bf7ee
Fix highlighting near beginning and end of buffer.
dict-mode.el
--- a/dict-mode.el	Wed Dec 21 21:49:03 2011 +0200
+++ b/dict-mode.el	Wed Dec 21 22:35:21 2011 +0200
@@ -29,14 +29,11 @@
 
 (defun dict-c5-font-lock-extend-region ()
   "Look for '_____' expression and extend `font-lock-beg' and `font-lock-end'."
-  ;; (message "%d, %d:%d" (point) font-lock-beg font-lock-end)
-  ;; (message "lines: %d" (count-lines font-lock-beg font-lock-end))
+  ;; (message "%d:%d, %d lines" font-lock-beg font-lock-end (count-lines font-lock-beg font-lock-end))
   (cond
    ((and
      (< (count-lines font-lock-beg font-lock-end) 5)
-     (< font-lock-end (point-max))
-     (< (point-min) font-lock-beg))
-    (message "XXX")
+     (not (and (<= (point-max) font-lock-end) (<= font-lock-beg (point-min)) )))
     (save-excursion
       (goto-char font-lock-beg)
       (forward-line -2)