BUG: Only count block open tokens if they are followed by an open paren.
This commit is contained in:
parent
878609935a
commit
419df21c06
@ -52,7 +52,7 @@
|
|||||||
"\\|" "[ \t\r\n]"
|
"\\|" "[ \t\r\n]"
|
||||||
"\\)*"))
|
"\\)*"))
|
||||||
|
|
||||||
(defconst cmake-regex-block-open "^\\(IF\\|MACRO\\|FOREACH\\|ELSE\\)")
|
(defconst cmake-regex-block-open "^\\(IF\\|MACRO\\|FOREACH\\|ELSE\\)$")
|
||||||
(defconst cmake-regex-block-close "^[ \t]*\\(ENDIF\\|ENDFOREACH\\|ENDMACRO\\|ELSE\\)[ \t]*(")
|
(defconst cmake-regex-block-close "^[ \t]*\\(ENDIF\\|ENDFOREACH\\|ENDMACRO\\|ELSE\\)[ \t]*(")
|
||||||
|
|
||||||
(defun cmake-line-starts-inside-string ()
|
(defun cmake-line-starts-inside-string ()
|
||||||
@ -113,7 +113,10 @@
|
|||||||
(if (string-match (concat "^" cmake-regex-paren-right "$") token)
|
(if (string-match (concat "^" cmake-regex-paren-right "$") token)
|
||||||
(setq cur-indent (- cur-indent cmake-tab-width))
|
(setq cur-indent (- cur-indent cmake-tab-width))
|
||||||
)
|
)
|
||||||
(if (string-match cmake-regex-block-open token)
|
(if (and
|
||||||
|
(string-match cmake-regex-block-open token)
|
||||||
|
(looking-at (concat "[ \t]*" cmake-regex-paren-left))
|
||||||
|
)
|
||||||
(setq cur-indent (+ cur-indent cmake-tab-width))
|
(setq cur-indent (+ cur-indent cmake-tab-width))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user