浏览代码

BUG: Don't open a block if a command starts with IF in its name.

Brad King 22 年之前
父节点
当前提交
218efecd89
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      Docs/cmake-mode.el

+ 4 - 4
Docs/cmake-mode.el

@@ -14,10 +14,10 @@
 ; Regular expressions used by line indentation function.
 (defconst cmake-regex-quoted "\"\\([^\n\"\\\\]\\|\\\\.\\)*\"")
 (defconst cmake-regex-arguments (concat "\\(" cmake-regex-quoted
-                                        "\\|" "[^\n()\\\\]"
+                                        "\\|" "[^\n()#\\\\]"
                                         "\\|" "\\\\."
                                         "\\)*"))
-(defconst cmake-regex-comment "#[^\n]*")
+(defconst cmake-regex-comment "#.*")
 (defconst cmake-regex-identifier "[A-Za-z][A-Za-z0-9_]*")
 (defconst cmake-indent-comment-line (concat "^[ \t]*" cmake-regex-comment))
 (defconst cmake-indent-blank-regex "^[ \t]*$")
@@ -29,8 +29,8 @@
                                            ")[ \t]*"
                                            "\\(" cmake-regex-comment "\\)?"
                                            "\n"))
-(defconst cmake-indent-begin-regex "^[ \t]*\\(IF\\|MACRO\\|FOREACH\\|ELSE\\)")
-(defconst cmake-indent-end-regex "^[ \t]*\\(ENDIF\\|ENDFOREACH\\|ENDMACRO\\|ELSE\\)")
+(defconst cmake-indent-begin-regex "^[ \t]*\\(IF\\|MACRO\\|FOREACH\\|ELSE\\)[ \t]*(")
+(defconst cmake-indent-end-regex "^[ \t]*\\(ENDIF\\|ENDFOREACH\\|ENDMACRO\\|ELSE\\)[ \t]*(")
 
 ; Line indentation function.
 (defun cmake-indent ()