aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/hideif.el
diff options
context:
space:
mode:
authorEli Zaretskii <[email protected]>2006-05-20 17:27:07 +0000
committerEli Zaretskii <[email protected]>2006-05-20 17:27:07 +0000
commitd689858f8aae8f00ebf5f149ce0bc8068d99e9fa (patch)
treeddc054df59ca8b375abcf48d3f461af24969a819 /lisp/progmodes/hideif.el
parent237d230e4eb951ac94dc8f592dad5e946e53b951 (diff)
(show-ifdef-block): Fix bug where parts of a hidden block remained hidden if
`hide-ifdef-lines' is non-nil.
Diffstat (limited to 'lisp/progmodes/hideif.el')
-rw-r--r--lisp/progmodes/hideif.el14
1 files changed, 8 insertions, 6 deletions
diff --git a/lisp/progmodes/hideif.el b/lisp/progmodes/hideif.el
index 04e44e2dac..a100424108 100644
--- a/lisp/progmodes/hideif.el
+++ b/lisp/progmodes/hideif.el
@@ -928,15 +928,17 @@ Return as (TOP . BOTTOM) the extent of ifdef block."
(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)))))