Tuesday, March 26, 2019

vim-xml-ftplugin vs. formatoptions

I've noticed that formatoptions+=c and a suitable textwidth value has no
effect with xml/xslt filetypes, and found this in
$VIMRUNTIME/autoload/xmlformat.vim:

func! xmlformat#Format()
" only allow reformatting through the gq command
" (e.g. Vim is in normal mode)
if mode() != 'n'
" do not fall back to internal formatting
return 0
endif
[...]

This is as shipped with 8.1.998, although the upstream version appears to
be identical at the moment. Kind of surprised at that -- is there some
underlying reason to disable auto formatting for XML filetypes?

Removing that mode() test definitely causes problems, figured I'd ask here
before digging any further...

-Rob

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: