Re: [vim/vim] long lines automatically become foldable even with set nowrap (Issue #21000)
Emilien Breton (Vim Github Repository) <[email protected]>
| Newsgroups | gmane.editors.vim.devel |
|---|---|
| Message-ID | <vim/vim/issues/21000/[email protected]> |
Bricktech2000 left a comment (vim/vim#21000) > With these settings, I'd expect indented lines can be folded by `zc`, and long lines cannot be folded by `zc`. I can achieve this behavior by running the first three of the four commands and leaving 'foldminlines' to its default value of 1. There is one little wart, in that a short single indented line won't be foldable, but you can fix that by setting 'foldminlines' to 0. > 'foldminlines' also changes how other folds behave. E.g. you have a foldexpr control the folding behavior (more complex than what is written in "steps to reproduce"), and then non-wrapped long lines become foldable regardless of foldexpr results Do you have a reproducible example of this? > Now that we are specifying folds manually by foldexpr, I would expect we can have the option to disable all the "baked-in mechanisms" of internal folds to have total manual control. I don't believe there are any such "backed-in" mechanisms. If you want 'foldexpr' to have full control of folds, you can set 'foldminlines' to 0, and then all folds will be visible, even single-line folds. If you don't want single-line folds, write your 'foldexpr' in such a way that it doesn't make any. > It would be great (though this would be a feature request) if we have an option, that can disable wrapped lines becoming foldable automatically even with set wrap. I don't think wrapped lines automatically become foldable. If I understand correctly, it appears so because `set foldexpr='>1'` puts each line of the buffer in its own little single-line fold, and 'foldminlines' being 1 by default prevents short lines from folding. If you set 'foldminlines' to 0, you'll see that every single line is foldable in its own little one-line fold. -- Reply to this email directly or view it on GitHub: https://github.com/vim/vim/issues/21000#issuecomment-5300019811 You are receiving this because you are subscribed to this thread. Message ID: <vim/vim/issues/21000/[email protected]> -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/issues/21000/5300019811%40github.com.