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

    Add a rule to align pipes (||). (#21)
    
    Align rules for string concatenation operators (#21)
---
 sql-indent.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sql-indent.el b/sql-indent.el
index af71edb..73d2d3b 100644
--- a/sql-indent.el
+++ b/sql-indent.el
@@ -2045,6 +2045,13 @@ determine how to indent each type of syntactic element."
      (group 1 2)
      (case-fold . t)
      (repeat . t))
+    ;; Line up the two sides of piped string
+    (sql-pipes
+     (regexp . "[^:]\\(\\s-*\\)||\\(\\s-*\\)[^>]")
+     (modes quote (sql-mode))
+     (group 1 2)
+     (case-fold . t)
+     (repeat . t))
     ;; lineup the column aliases (the "as name" part) in a select statement
     (sql-select-lineup-column-names
      (regexp . ".*?\\(\\s +\\)as\\(\\s +\\).*")

Reply via email to