Skip to content

Commit

Permalink
html comment folding
Browse files Browse the repository at this point in the history
  • Loading branch information
fxbois committed Feb 19, 2017
1 parent 38c6e78 commit dafb6c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/demo.psp
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
print("hello");
}
?>
<!-- test folding -->
</div>
11 changes: 9 additions & 2 deletions web-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

;; Copyright 2011-2017 François-Xavier Bois

;; Version: 14.0.43
;; Version: 14.0.44
;; Author: François-Xavier Bois <fxbois AT Google Mail Service>
;; Maintainer: François-Xavier Bois
;; URL: http://web-mode.org
Expand All @@ -21,7 +21,7 @@

;;---- CONSTS ------------------------------------------------------------------

(defconst web-mode-version "14.0.43"
(defconst web-mode-version "14.0.44"
"Web Mode version.")

;;---- GROUPS ------------------------------------------------------------------
Expand Down Expand Up @@ -9058,6 +9058,13 @@ Prompt user if TAG-NAME isn't provided."
(setq end-inside (point))
(setq end-outside (1+ (web-mode-block-end-position (point)))))
)
;; *** html comment folding
((eq (get-text-property (point) 'tag-type) 'comment)
(setq beg-outside (web-mode-tag-beginning-position))
(setq beg-inside (+ beg-outside 4))
(setq end-outside (web-mode-tag-end-position))
(setq end-inside (- end-outside 3))
)
;; *** tag folding
((or (member (get-text-property (point) 'tag-type) '(start end))
(web-mode-element-parent))
Expand Down

0 comments on commit dafb6c0

Please sign in to comment.