changeset 70769:c1396ff7810f

(show-ifdef-block): Fix bug where parts of a hidden block remained hidden if `hide-ifdef-lines' is non-nil.
author Eli Zaretskii <eliz@gnu.org>
date Sat, 20 May 2006 17:26:27 +0000
parents c3d4f6eacc0f
children 6fe80a48b58a
files lisp/progmodes/hideif.el
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/hideif.el	Sat May 20 14:40:56 2006 +0000
+++ b/lisp/progmodes/hideif.el	Sat May 20 17:26:27 2006 +0000
@@ -928,15 +928,17 @@
     (setq hide-ifdef-hiding t))
   (setq buffer-read-only (or hide-ifdef-read-only hif-outside-read-only)))
 
-
 (defun show-ifdef-block ()
   "Show the ifdef block (true or false part) enclosing or before the cursor."
   (interactive)
-  (if hide-ifdef-lines
-      (save-excursion
-	(beginning-of-line)
-	(hif-show-ifdef-region (1- (point)) (progn (end-of-line) (point))))
-    (let ((top-bottom (hif-find-ifdef-block)))
+  (let ((top-bottom (hif-find-ifdef-block)))
+    (if hide-ifdef-lines
+ 	(hif-show-ifdef-region
+ 	 (save-excursion
+ 	   (goto-char (car top-bottom)) (line-beginning-position))
+ 	 (save-excursion
+ 	   (goto-char (1+ (cdr top-bottom)))
+	   (hif-end-of-line) (point)))
       (hif-show-ifdef-region (1- (car top-bottom)) (cdr top-bottom)))))