[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/web-mode cb18eeb7d4 1/2: razor indent
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/web-mode cb18eeb7d4 1/2: razor indent |
Date: |
Sun, 25 Dec 2022 07:59:53 -0500 (EST) |
branch: elpa/web-mode
commit cb18eeb7d406bf55f1f0f77bf0c2425a72e4042b
Author: fxbois <fxbois@gmail.com>
Commit: fxbois <fxbois@gmail.com>
razor indent
#1209
---
issues/1209.cshtml | 11 +++++++++++
web-mode.el | 12 ++++++++++--
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/issues/1209.cshtml b/issues/1209.cshtml
new file mode 100644
index 0000000000..bb3d91b94a
--- /dev/null
+++ b/issues/1209.cshtml
@@ -0,0 +1,11 @@
+<div>
+ @if (true)
+ {
+ <h1>welcome</h1>
+ <p>hello</p>
+ }
+ else
+ {
+
+ }
+</div>
diff --git a/web-mode.el b/web-mode.el
index 86a7474470..0363073478 100644
--- a/web-mode.el
+++ b/web-mode.el
@@ -2,7 +2,7 @@
;; Copyright 2011-2023 François-Xavier Bois
-;; Version: 17.3.7
+;; Version: 17.3.8
;; Author: François-Xavier Bois
;; Maintainer: François-Xavier Bois <fxbois@gmail.com>
;; Package-Requires: ((emacs "23.1"))
@@ -23,7 +23,7 @@
;;---- CONSTS
------------------------------------------------------------------
-(defconst web-mode-version "17.3.7"
+(defconst web-mode-version "17.3.8"
"Web Mode version.")
;;---- GROUPS
------------------------------------------------------------------
@@ -8770,6 +8770,14 @@ Also return non-nil if it is the command
`self-insert-command' is remapped to."
(when debug (message "I140(%S) mason" pos))
(setq offset 0))
+ ((and (string= web-mode-engine "razor")
+ (string-match-p "^\\([{}]\\|else\\)" curr-line))
+ (when debug (message "I142(%S) razor" pos))
+ (save-excursion
+ (web-mode-block-previous)
+ (setq offset (current-indentation))
+ ))
+
((and (string= web-mode-engine "django")
(string-match-p "^#" curr-line))
(when debug (message "I144(%S) django line statements" pos))