Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indentation of multiple lines in a directive is too large in a blade file #1318

Open
Tacumi opened this issue Jan 24, 2025 · 2 comments
Open

Comments

@Tacumi
Copy link

Tacumi commented Jan 24, 2025

When buffer indenting(C-c C-TAB), I got too big indent inside props directive.

@props (
						 ['attr_name',
						  'errors',
						  'safe' => false,
						 ])

Actual: web-mode inserted 51 spaces before [.
Expected: It should be inserted 2, 4 or specific-indentation spaces.


web-mode version: be2d59c8

version output

GNU Emacs 29.4 (build 1, aarch64-apple-darwin21.6.0, NS appkit-2113.60 Version 12.6.6 (Build 21G646)) of 2024-08-03

web-mode-debug output

--- WEB-MODE DEBUG BEG ---
versions: emacs(29.4) web-mode("17.3.21")
vars: engine(nil) minor(nil) content-type("") file("*Messages*")
system: window(ns) config("aarch64-apple-darwin21.6.0")
colors: fg(nil) bg(nil) 
minor modes: (indent-tabs-mode buffer-read-only show-paren-mode global-eldoc-mode leaf-key-override-global-mode shell-dirtrack-mode magit-auto-revert-mode global-git-commit-mode treemacs-fringe-indicator-mode treemacs-git-mode treemacs-follow-mode treemacs-filewatch-mode)
vars:
web-mode-enable-current-column-highlight=nil 
web-mode-enable-current-element-highlight=nil 
indent-tabs-mode=t 
--- WEB-MODE DEBUG END ---

init.el

;; <leaf-install-code>
(eval-and-compile
  (customize-set-variable
   'package-archives '(("org" . "https://orgmode.org/elpa/")
                       ("melpa" . "https://melpa.org/packages/")
                       ("gnu" . "https://elpa.gnu.org/packages/")))
  (package-initialize)
  (unless (package-installed-p 'leaf)
    (package-refresh-contents)
    (package-install 'leaf))

  (leaf leaf-keywords
    :ensure t
    :init
    ;; optional packages if you want to use :hydra, :el-get, :blackout,,,
    (leaf hydra :ensure t)
    (leaf el-get :ensure t)
    (leaf blackout :ensure t)

    :config
    ;; initialize leaf-keywords.el
    (leaf-keywords-init)))
;; </leaf-install-code>

;; Now you can use leaf!
(leaf leaf-tree :ensure t)
(leaf leaf-convert :ensure t)
(leaf transient-dwim
  :ensure t
  :bind (("M-=" . transient-dwim-dispatch)))

(leaf web-mode
  :ensure t
  :mode
  ("\\.astro\\'" "\\.mjs\\'" "\\.cjs\\'")
  :custom
  (web-mode-markup-indent-offset . 2)
  (web-mode-css-indent-offset . 2)
  (web-mode-code-indent-offset . 2)
  (web-mode-enable-autopairing . t))
@fxbois
Copy link
Owner

fxbois commented Jan 24, 2025

Please post a more complete example on gist

@Tacumi
Copy link
Author

Tacumi commented Jan 24, 2025

Thank you.

This is a full laravel component file.(Please see 3rd example code on Docs)

Actual Behaviour:
https://gist.github.com/Tacumi/b556dc1579f4a5209e9792772337de8f

Expected Behaviour:
https://gist.github.com/Tacumi/e2300c87f565cfb5307bdddb5b5a7ba0

My init.el is more complex, however the compact init.el like avove causes same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants