#why same line "fmt: off" moving?

1 messages · Page 1 of 1 (latest)

woeful iris
#

if i write "// zig fmt: off" with indent in my code block like this:

// block_1 {{{
    // zig fmt: off
    // block_2 {{{
        // very strange comment
    // }}}
    // zig fmt: on
// }}}

if i try zig fmt - zig just remove indent in line "// zig fmt: off". but i use folding blocks (by indent) in editor and i want see text like ```
// block_1 {{{
// }}}

 and not 

// block_1 {{{
// zig fmt: off
// }}}

and not ```
// zig fmt: off
// block_1 {{{
// }}}

it does not make sense....

winter jolt
#

so all of these lines are commented out?

#

what editor?

woeful iris
# winter jolt so all of these lines are commented out?

yes. its just "TODO" list with nested tasks. but this may be needed in any nested block.
i use self writed text editor (Right now I'm trying to write a gluing using the symbols "{{{" and "}}}" for refolding after folding by indent. ) but folding by indent is not my exclusive function. example in vim:
1) before fmt
2) with folding by indent
3) after zig fmt
4) with folding by indent

If this line didn’t move, I wouldn’t need “{{{” in this block at all.

winter jolt
#

So you're asking why it moved //zig fmt: off?

#

I guess you do

#

I guess that's how it's supposed to work? It stops applying its formatting to lines after the line with that comment

#

probably

#

And it doesn't apply it to the last line that turns it on, because it is still off while processing that line

woeful iris
#

How can I make sure he doesn't do that?

winter jolt
#

Check if there's an option for it in its docs / source code (there likely isn't). I see you have considered putting it before the list too, which is what I'd do. If that doesn't suit you, you'll have to look for the option.

#

I don't use zig fmt at all

woeful iris
#

Unfortunately, the creator of the language is literally forcing me to use zig fmt. New versions of the language get rid of some bugs because of which I could not, in principle, copy my project. And changes in the language are promised to be “applied” automatically with the help of the zig fmt tool, which, in addition to correcting the code, also formats it. Of course, I understand that the language has not yet been stabilized and this will continue for some time. But the "fmt" tool itself is literally imposed. And this applies not only to the zig language. For example, here in questions and answers this is not the first time they have asked how to disable file reformatting when saving in vs code.

#

who put the symbol decided? It's not decided yet 😦

winter jolt
winter jolt
woeful iris
low dock
#

it's not, you click that to react to indicate it's answered

winter jolt
#

decided -> resolved

woeful iris
#

where decided???

winter jolt
#

ic

#

it will have a one next to it when people mark it as resolved

woeful iris
winter jolt
#

the symbol is just there to be able to react easily

low dock
#

I know, I can see that

#

if you'll notice, all posts have it there

#

the ones that are answered show that someone has reacted

woeful iris
low dock
#

weird bug perhaps

#

anyway, take my word for it