branch: elpa/web-mode
commit 1eb0abb1a9bffbb33db7bbfc6efe5b48bf416d57
Author: fxbois <fxb...@gmail.com>
Commit: fxbois <fxb...@gmail.com>

    improve liquid block indentation
    
    #1323
---
 issues/1323.djhtml | 11 +++++++++++
 web-mode.el        |  7 ++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/issues/1323.djhtml b/issues/1323.djhtml
new file mode 100644
index 00000000000..e9ea0aaa601
--- /dev/null
+++ b/issues/1323.djhtml
@@ -0,0 +1,11 @@
+<div>
+  {% liquid
+  assign names = 'Bob, Sally' | split: ', '
+  for name in names
+    echo 'Hello, ' | append: name
+    unless forloop.last
+      echo ', '
+    endunless
+  endfor
+  %}
+</div>
diff --git a/web-mode.el b/web-mode.el
index 5b640012f6e..391a60a5dc3 100644
--- a/web-mode.el
+++ b/web-mode.el
@@ -9649,9 +9649,14 @@ Also return non-nil if it is the command 
`self-insert-command' is remapped to."
                                                               language
                                                               reg-beg))))
 
+          ((member language '("django"))
+           (when debug (message "I430(%S) django-indentation" pos))
+           (setq offset nil)
+           )
+
           (t
            (when debug
-             (message "I430(%S) bracket-indentation" pos)
+             (message "I440(%S) generic bracket-indentation" pos)
              ;;(message "reg-col=%S curr-ind=%S lang=%S reg-beg=%S" reg-col 
curr-indentation language reg-beg)
              )
            (setq offset (car (web-mode-bracket-indentation pos

Reply via email to