mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 12:49:50 -05:00
cmake-mode.el: fix bracket string/comment syntax-propertize
With `lexical-binding: t`, the `end` variable is undefined in `cmake--syntax-propertize-until-bracket-close`, causing syntax highlighting errors. This fixes that by passing `end` from the caller.
This commit is contained in:
@@ -279,7 +279,7 @@ Return t unless search stops due to end of buffer."
|
|||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
|
|
||||||
(defun cmake--syntax-propertize-until-bracket-close (syntax)
|
(defun cmake--syntax-propertize-until-bracket-close (syntax end)
|
||||||
;; This function assumes that a previous search has matched the
|
;; This function assumes that a previous search has matched the
|
||||||
;; beginning of a bracket_comment or bracket_argument and that the
|
;; beginning of a bracket_comment or bracket_argument and that the
|
||||||
;; second capture group has matched the equal signs between the two
|
;; second capture group has matched the equal signs between the two
|
||||||
@@ -307,10 +307,10 @@ Return t unless search stops due to end of buffer."
|
|||||||
(syntax-propertize-rules
|
(syntax-propertize-rules
|
||||||
("\\(#\\)\\[\\(=*\\)\\["
|
("\\(#\\)\\[\\(=*\\)\\["
|
||||||
(1
|
(1
|
||||||
(prog1 "!" (cmake--syntax-propertize-until-bracket-close "!"))))
|
(prog1 "!" (cmake--syntax-propertize-until-bracket-close "!" end))))
|
||||||
("\\(\\[\\)\\(=*\\)\\["
|
("\\(\\[\\)\\(=*\\)\\["
|
||||||
(1
|
(1
|
||||||
(prog1 "|" (cmake--syntax-propertize-until-bracket-close "|"))))))
|
(prog1 "|" (cmake--syntax-propertize-until-bracket-close "|" end))))))
|
||||||
|
|
||||||
;; Syntax table for this mode.
|
;; Syntax table for this mode.
|
||||||
(defvar cmake-mode-syntax-table nil
|
(defvar cmake-mode-syntax-table nil
|
||||||
|
|||||||
Reference in New Issue
Block a user