On Mon, February 14, 2011 11:21 am, Yue Wu wrote: > On Mon, Feb 14, 2011 at 08:38:46PM +1100, Ben Schmidt wrote: >> On 14/02/11 4:12 PM, Yue Wu wrote: >> > On Sun, Feb 13, 2011 at 07:30:57PM -0800, Ben Fritz wrote: >> >> On Feb 12, 6:10 pm, Yue Wu<[email protected]> wrote: >> >>> On Sat, Feb 12, 2011 at 09:42:42AM -0800, Ben Fritz wrote: >> >>>> On Feb 12, 8:15 am, Yue Wu<[email protected]> wrote: >> >>>>> As the title, when setting wrap, long lines that extent outside >> the screen will >> >>>>> be showed as a folding, is it a bug or feature? >> >>> >> >>>> I've never seen this before. What's your 'foldmethod' setting? What >> >>>> gets folded, just the single long line? >> >>> >> >>>> -- >> >>>> 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, visithttp://www.vim.org/maillist.php >> >>> >> >>> Hi Fritz, the reproduce way is: >> >>> >> >>> Run vim, then run commands as follows: >> >>> >> >>> :set foldmethod=expr >> >>> :set foldexpr=getline(v:lnum)[0]==\"\\t\" >> >>> :set nowrap >> >>> :set textwidth=0 >> >>> >> >>> Then input a very long line starts with a<tab> and is longer than >> your vim >> >>> screen. >> >>> >> >>> Then start a new line. You can find that the first line can be >> folded using any >> >>> folding commands. >> >>> >> >> >> >> I'm confused. You specified a fold expression that would fold your >> >> line, and are surprised that the line gets folded? >> >> >> > But that is a one screen line, not multiple screen lines come from a >> one >> > long line, why one screen line should get folded itself? >> >> Why not? You told it to! >> >> I admit it might seem a little strange. But if you don't want that >> strangeness, you would need to change your fold expression, not expect >> Vim to guess that you want something different. >> >> I think this is definitely 'feature', not 'bug'. And it may be helpful >> for people if the foldtext or highlighting has some meaning for them. >> > > But folding for one line makes no sense at all, it confuses people to > think that there're multiple lines at there, but actually it isn't. > > And you can test, if the line is shorter than screen line, then no > folding for it, why not, if you say it's a feature? It should be folded > too.
See the 'foldminline' setting. I was a little bit confused too by this behaviour, but it is documented and expected. Though, somehow the foldminline setting is not always correctly applied. It seems necessary to manually set 'fml' to have the folding reevaluated, if the screen line length changes (i.e. a :let &fml=&fml usually fixes the behaviour that a line which has grewn longer than 'fml' will not get folded). regards, Christian -- 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
