[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/jinja2-mode 487b95f0d4 20/57: Merge pull request #1 from a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/jinja2-mode 487b95f0d4 20/57: Merge pull request #1 from amirouche/master |
Date: |
Mon, 17 Jan 2022 05:58:24 -0500 (EST) |
branch: elpa/jinja2-mode
commit 487b95f0d45b3def632c6114c95264f4111e4dd0
Merge: c262cace36 83eaa513b5
Author: Mounier Florian <paradoxxx.zero@gmail.com>
Commit: Mounier Florian <paradoxxx.zero@gmail.com>
Merge pull request #1 from amirouche/master
configurable indentation & jinja2-mode.el filename
---
jinja2.el => jinja2-mode.el | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/jinja2.el b/jinja2-mode.el
similarity index 92%
rename from jinja2.el
rename to jinja2-mode.el
index 9aabd26d88..dc1ca54a0a 100644
--- a/jinja2.el
+++ b/jinja2-mode.el
@@ -228,24 +228,25 @@
(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"
(if (bobp) ; Check begining of buffer
0
- (let ((indent-width 2) (default (sgml-indent-line-num)))
+ (let ((indent-width sgml-basic-offset) (default (sgml-indent-line-num)))
(if (looking-at "^[ \t]*{% *e\\(nd\\|lse\\|lif\\)") ; Check close tag
(save-excursion
(forward-line -1)
- [nongnu] elpa/jinja2-mode 832c03e0a2 35/57: elpa compatibility, (continued)
- [nongnu] elpa/jinja2-mode 832c03e0a2 35/57: elpa compatibility, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 67ab5f0bb4 14/57: Add tags insertion, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode bbfe9b4940 30/57: Add logic operators, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 2dc43224b2 09/57: Now kw are function and user can define user kw list, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode c2d801ad8e 21/57: fix indentation bug, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode a6e6574441 37/57: Consider quote as quote, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 97dacbedac 15/57: Add indent on insert tags, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 40c5ef2efa 23/57: Fuck tab, ELPA Syncer, 2022/01/17
- [nongnu] elpa/jinja2-mode 159558e0bb 54/57: Indent on save only when enabled, default disabled, ELPA Syncer, 2022/01/17
- [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 <=
- [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, 2022/01/17