Indentation level is calculated incorrectly for lines mixing tabs and spaces #6262
Labels
C-bug
Category: This is a bug
E-easy
Call for participation: Experience needed to fix: Easy / not much
E-good-first-issue
Call for participation: Issues suitable for new contributors
E-has-instructions
Call for participation: Has instructions for fixing the issue and opening a PR
Indentation of existing lines is calculated with (
helix_core::indent
):This works for lines that are purely indented with spaces or tabs (so almost always) but in the edge-case that a lines is indented with a mix of tabs and spaces (for some ungodly reason) then the result is incorrect because the width of a tab differs in that case. The fix is simple: use
helix_core::graphemes::tab_width
to calculate the tab width instead in the function mentioned above.CC @Triton171 (in case I missed something)
The text was updated successfully, but these errors were encountered: