You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! Don't know if this is the designed behavior or some kind of bug but if I have this markdown snippet, then the default de-indentation work without problems:
I'm opening this issue cause there is no mention for this in the docs (at least in the dedent description :h luasnip-extras-fmt, /dedent) and took me some time to figure out what was happening.
Possible solutions
Add to the docs that the dedent feature requires the multiline string to begin with a newline
dedent the multiline string even for this cases: [=[no newline char
Regards
The text was updated successfully, but these errors were encountered:
I think this is somewhat expected, if "remove common indent from the snippet's lines" is taken very literally: the first line does not have any whitespace in front of the string, so the "common indent" can be at most an empty string, and the subsequent lines' indentation is thus treated as not indentation but just leading whitespace.
I'd appreciate if you'd add this as a kind of hint to the documentation, if not I can also find some time to do so :)
Yes, if you put it in those terms, then it's kind of obvious 😅.
What about this?:
- `dedent`: remove indent common to all lines in `format`. Again, makes
passing multiline-strings a bit nicer (default true). (Remember to
add the indentation on the first line too.)
Description
Hi! Don't know if this is the designed behavior or some kind of bug but if I have this markdown snippet, then the default de-indentation work without problems:
output:
But if
[=[text
is used, then it doesn't work:output:
I'm opening this issue cause there is no mention for this in the docs (at least in the
dedent
description:h luasnip-extras-fmt
,/dedent
) and took me some time to figure out what was happening.Possible solutions
[=[no newline char
Regards
The text was updated successfully, but these errors were encountered: