Christian Brabandt wrote: > On Mo, 12 Mai 2014, Christian Brabandt wrote: > > > Thanks, I enhanced it further. You can adjust the behaviour now using > > :set breakindentopt > > For now, I put the patch here: > > https://raw.githubusercontent.com/chrisbra/vim-mq-patches/master/breakindent_patch > > I'll plan to keep it updated for a bit and will try to keep it in sync > with upstream Vim. If someone has problems with it (or I forgot to > update it) please ping me or open an issue (or something like that). > > (There is also the vartabs patch. I haven't merged it for a while and > unfortunately, both of these patches collide a little bit).
A few remarks from looking at the patch. There aren't any tests, while there are lots of changes to the source code. It would be really useful to have tests, instead of hoping that later changes won't break the feature. The line number argument is added to lbr_chartabsize(). Instead it should pass a pointer to the start of the line. Fetching the line again may cause trouble. I also wonder if recomputing the indent every time can't be avoided. As far as I can see the result of the computation is the same every time. Perhaps the value can be cached for as long as working on the same line. The lnum argument to strdisplaywidth() doesn't work if the text is not in the current window. Instead the text for the indent should be passed. The result of parsing breakindentopts should not be put in w_p_* fields. These names are used for actual options, not parsed values. Looks like a leftover from when this was a bunch of options instead of one option with several items. The FIXME items need to be fixed... -- If evolution theories are correct, humans will soon grow a third hand for operating the mouse. /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- 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]. For more options, visit https://groups.google.com/d/optout.
