1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-01-27 19:31:38 +00:00

(show-ifdef-block): Fix bug where parts of a hidden block remained hidden if

`hide-ifdef-lines' is non-nil.
This commit is contained in:
Eli Zaretskii 2006-05-20 17:27:07 +00:00
parent 237d230e4e
commit d689858f8a
2 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2006-05-20 Martin Rudalics <rudalics@gmx.at>
* progmodes/hideif.el (show-ifdef-block): Fix bug where parts of
a hidden block remained hidden if `hide-ifdef-lines' is non-nil.
2006-05-20 Stefan Monnier <monnier@iro.umontreal.ca>
* progmodes/gud.el (gdb-script-font-lock-keywords): Use a stricter

View File

@ -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)))))