[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/jinja2-mode 83eaa513b5 19/57: looks like the indentation a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/jinja2-mode 83eaa513b5 19/57: looks like the indentation at 4 is now possible inside jinja2 blocks |
Date: |
Mon, 17 Jan 2022 05:58:24 -0500 (EST) |
branch: elpa/jinja2-mode
commit 83eaa513b5942ba14420191d2f734fbe62c8bcea
Author: abki <amirouche.boubekki@gmail.com>
Commit: abki <amirouche.boubekki@gmail.com>
looks like the indentation at 4 is now possible inside jinja2 blocks
---
jinja2-mode.el | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/jinja2-mode.el b/jinja2-mode.el
index 045e095b5c..dc1ca54a0a 100644
--- a/jinja2-mode.el
+++ b/jinja2-mode.el
@@ -228,18 +228,19 @@
(defun jinja2-calculate-indent-backward (default)
"Return indent column based on previous lines"
(forward-line -1)
- (if (looking-at "^[ \t]*{% *end") ; Don't indent after end
- (current-indentation)
- (if (looking-at (concat "^[ \t]*{% *.*?{% *end" (regexp-opt
(jinja2-indenting-keywords))))
+ (let ((indent-width sgml-basic-offset) (default (sgml-indent-line-num)))
+ (if (looking-at "^[ \t]*{% *end") ; Don't indent after end
(current-indentation)
- (if (looking-at (concat "^[ \t]*{% *" (regexp-opt
(jinja2-indenting-keywords)))) ; Check start tag
- (+ (current-indentation) indent-width)
- (if (looking-at "^[ \t]*<") ; Assume sgml block trust sgml
- default
- (if (bobp)
- 0
- (jinja2-calculate-indent-backward default)))))))
-
+ (if (looking-at (concat "^[ \t]*{% *.*?{% *end" (regexp-opt
(jinja2-indenting-keywords))))
+ (current-indentation)
+ (if (looking-at (concat "^[ \t]*{% *" (regexp-opt
(jinja2-indenting-keywords)))) ; Check start tag
+ (+ (current-indentation) indent-width)
+ (if (looking-at "^[ \t]*<") ; Assume sgml block trust sgml
+ default
+ (if (bobp)
+ 0
+ (jinja2-calculate-indent-backward default))))))))
+
(defun jinja2-calculate-indent ()
"Return indent column"
- [nongnu] elpa/jinja2-mode b3e564bfef 40/57: Fix uncomment, (continued)
- [nongnu] elpa/jinja2-mode b3e564bfef 40/57: Fix uncomment, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 487b95f0d4 20/57: Merge pull request #1 from amirouche/master, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 757e3fa162 25/57: Add defcustom for kw and fun, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 985c538160 28/57: Add comment command, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode ab077df663 24/57: Support whitespace tag syntax, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode f98adc4211 34/57: Merge pull request #5 from davidmiller/patch-1, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode bc2f7ddcb5 41/57: Fix indent, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 69171a2baa 26/57: Switch back to sgml-mode, seems to fix #3, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 66d20afc30 13/57: Change indent func to recursive, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode bcca3fe63b 17/57: renamed jinja2 -> jinja2-mode so that require 'jinja2-mode works, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 83eaa513b5 19/57: looks like the indentation at 4 is now possible inside jinja2 blocks,
ELPA Syncer <=