web-mode
web-mode copied to clipboard
Svelte - alignment/indent-region issues
I have the following code:
<tr
on:click|preventDefault={event => true}
class="AAA">
If I edit this file as test.svelte
, select the entire buffer and run indent-region
, I would expect it to horizontally align the on:click
and class attributes. If I rename the file to test.html
and rerun, it aligns correctly. If I remove the pipe (|
) character, it also correctly aligns. The pipe is used semi-regularly in svelte, https://svelte.dev/tutorial/event-modifiers .
Running indent-region multiple times against the poc will sometimes align it correctly, not sure why but that behavior isn't reproducible in real-world samples.
Have tested on web-mode latest, and confirmed via web-mode within apt repos on a vanilla Ubuntu VM.
The following also breaks:
<Example
a={b}
c={d}
e={f}
g={h}
i={j}
/>
The behavior changes when the character length of property a
changes (e.g. abcdef={b}
), also when values d
and h
are removed (c={}
).
should be fixed with last commit
Thanks, can confirm both pocs are fixed!