branch: externals/sql-indent
commit 2e43a73bc12bd39ad5a3167625ba563e00cc6c75
Author: Pierre Téchoueyres <[email protected]>
Commit: Alex Harsányi <[email protected]>

    Exclude equals inside strings from alignments. (#20)
    
    Update align rules to ignore equal signs inside strings (#20)
---
 sql-indent.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sql-indent.el b/sql-indent.el
index 73d2d3b..53d7c44 100644
--- a/sql-indent.el
+++ b/sql-indent.el
@@ -2010,7 +2010,7 @@ determine how to indent each type of syntactic element."
 ;;;; Alignment rules
 
 (defvar sqlind-align-rules
-  '(;; Line up the two side of arrow =>
+  `(;; Line up the two side of arrow =>
     (sql-arrow-lineup
      (regexp . "\\(\\s-*\\)=>\\(\\s-*\\)")
      (modes quote (sql-mode))
@@ -2044,6 +2044,10 @@ determine how to indent each type of syntactic element."
      (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

Reply via email to