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
When :reflow is used with comments that are indented via spaces, it correctly maintains the common prefix on all lines. However, with tabs, it treats the tabs and the comment prefix as if they were regular characters, and ends up breaking the comment.
Reproduction Steps
I tried this:
Write the following to a file (ensuring that tab-indentation is used):
// main.gopackage main
funcmain() {
// Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod// tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim// veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea// commodo consequat. Duis aute irure dolor in reprehenderit in voluptate// velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint// occaecat cupidatat non proident, sunt in culpa qui officia deserunt// mollit anim id est laborum.println("Hello, world!")
}
hx main.go
Select comment
:reflow 100
I expected this to happen:
The document becomes something like:
package main
funcmain() {
// Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt// ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco// laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit// in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat// cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.println("Hello, world!")
}
Instead, this happened:
The document becomes:
package main
funcmain() {
// Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod // tempor incididunt utlaboreetdoloremagna aliqua. Utenimadminim// veniam, quis nostrud exercitation ullamco laborisnisiutaliquipexea// commodo consequat. Duis aute irure dolor in reprehenderit in voluptate// velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint // occaecat cupidatat nonproident, suntinculpaquiofficiadeserunt// mollit anim id est laborum.println("Hello, world!")
}
Helix log
No response
Platform
Linux
Terminal Emulator
kitty 0.25.2
Helix Version
22.05-440-ge0667827
Edit: I am working on a fix for this, just thought I'd post this for a clear explanation of the motivation for the eventual PR.
Edit 2: Also, now that I've looked into the code, it looks like tab-width is totally unaccounted for too. Tabs currently count as zero width 😬.
The text was updated successfully, but these errors were encountered:
Summary
When
:reflow
is used with comments that are indented via spaces, it correctly maintains the common prefix on all lines. However, with tabs, it treats the tabs and the comment prefix as if they were regular characters, and ends up breaking the comment.Reproduction Steps
I tried this:
hx main.go
:reflow 100
I expected this to happen:
The document becomes something like:
Instead, this happened:
The document becomes:
Helix log
No response
Platform
Linux
Terminal Emulator
kitty 0.25.2
Helix Version
22.05-440-ge0667827
Edit: I am working on a fix for this, just thought I'd post this for a clear explanation of the motivation for the eventual PR.
Edit 2: Also, now that I've looked into the code, it looks like tab-width is totally unaccounted for too. Tabs currently count as zero width 😬.
The text was updated successfully, but these errors were encountered: