Skip to content

Request: no-mixed-spaces mode #19

Open
@cxw42

Description

@cxw42

Please see attached foo.txt. Line 2 has fifteen leading spaces. Running

wtf -v -s -y 8 foo.txt | xxd -g1

changes the first 8 spaces to a tab and leaves the last 7 spaces:

	CHANGED 8 spaces to tabs on 1 lines
00000000: 30 31 32 33 34 35 36 37 38 39 61 62 63 64 65 66  0123456789abcdef
00000010: 0a 09 20 20 20 20 20 20 20 68 65 6c 6c 6f 21 0a  ..       hello!.

I would like to request a mode in which any trailing group of spaces after a leading group of tabs would be converted to a single tab. Unlike -y N, this would convert every group of up to N spaces to a tab.

The use case is Linux kernel coding, which uses hard tabs. I care more about consistency than exact-column indentation. clang-format will give me tab+space mix, and I'd like to use wtf to convert those last few spaces to one additional tab per line.

Thanks for considering this request!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions