branch: externals/sql-indent
commit 59f99cd2bd8b653e3727e0cfd183c3be79f1f71e
Author: Alex Harsanyi <[email protected]>
Commit: Alex Harsanyi <[email protected]>
new alignment rule for issue #47
---
sql-indent.el | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/sql-indent.el b/sql-indent.el
index bd12c8b..8780adc 100644
--- a/sql-indent.el
+++ b/sql-indent.el
@@ -2168,14 +2168,24 @@ determine how to indent each type of syntactic element."
(repeat . t))
;; Line up the two sides of an equal sign in an update expression
(sql-equals
- (regexp . "[^:]\\(\\s-*\\)=\\(\\s-*\\)[^>]")
+ (regexp . "[^:<>!]\\(\\s-*\\)=\\(\\s-*\\)[^>]")
(modes quote (sql-mode))
(group 1 2)
(case-fold . t)
(valid . ,(function (lambda ()
- (save-excursion
- (goto-char (match-end 1))
- (not (nth 3 (syntax-ppss (point))))))))
+ (save-excursion
+ (goto-char (match-end 1))
+ (not (nth 3 (syntax-ppss (point))))))))
+ (repeat . t))
+ (sql-comparison-operators ; see issue #47
+ (regexp . "[^:]\\(\\s-*\\)[<>=!]+\\(\\s-*\\)[^>]")
+ (modes quote (sql-mode))
+ (group 1 2)
+ (case-fold . t)
+ (valid . ,(function (lambda ()
+ (save-excursion
+ (goto-char (match-end 1))
+ (not (nth 3 (syntax-ppss (point))))))))
(repeat . t))
;; Line up the two sides of piped string
(sql-pipes