emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/web-mode ff394e83b4: index fix with lineup-args


From: ELPA Syncer
Subject: [nongnu] elpa/web-mode ff394e83b4: index fix with lineup-args
Date: Fri, 17 Mar 2023 07:02:42 -0400 (EDT)

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

    index fix with lineup-args
    
    #1268 #1212
---
 issues/1268.psp | 20 ++++++++++++++++++++
 web-mode.el     | 17 ++++++++++++++---
 2 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/issues/1268.psp b/issues/1268.psp
new file mode 100644
index 0000000000..a0fe4d7cb5
--- /dev/null
+++ b/issues/1268.psp
@@ -0,0 +1,20 @@
+<div>
+  <?php
+  $x = ['a' => 0,
+        'b' => 1,
+        'c' => 2
+  ];
+
+  $y = array(
+    'a' => 0,
+    'b' => 1,
+    'c' => 2
+  );
+
+  function_call(
+    $arg0,
+    $arg1,
+    $arg2
+  );
+  ?>
+</div>
diff --git a/web-mode.el b/web-mode.el
index eda5da795a..bfbafb883d 100644
--- a/web-mode.el
+++ b/web-mode.el
@@ -2,7 +2,7 @@
 
 ;; Copyright 2011-2023 François-Xavier Bois
 
-;; Version: 17.3.8
+;; Version: 17.3.9
 ;; 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.8"
+(defconst web-mode-version "17.3.9"
   "Web Mode version.")
 
 ;;---- GROUPS 
------------------------------------------------------------------
@@ -9365,7 +9365,18 @@ Also return non-nil if it is the command 
`self-insert-command' is remapped to."
                 (setq offset (- offset (length (match-string-no-properties 
0)))))
               )
              (t
-              (setq offset (+ (current-indentation) 
web-mode-code-indent-offset)))
+              (setq offset (current-column))
+              ;;(message "point=%S offset=%S" (point) offset)
+              (if (looking-back "[ ]+" (point-min))
+                  (progn
+                    (setq offset (current-indentation)))
+                (setq offset (+ (current-indentation) 
web-mode-code-indent-offset)))
+              ;;(when (eq curr-char ?\,)
+              ;;  (goto-char pos)
+              ;;  (looking-at ",[ \t\n]*")
+              ;;  (setq offset (- offset (length (match-string-no-properties 
0)))))
+              ;;(setq offset (+ (current-indentation) 
web-mode-code-indent-offset))
+              ) ;t
              ))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]