Christian wrote:

> On Do, 10 Mai 2018, Bram Moolenaar wrote:
> 
> > > On Mi, 09 Mai 2018, Bram Moolenaar wrote:
> > > 
> > > > Thanks, I can include them.
> > > > 
> > > > For the xmlformat file, we would need some help entry with an example.
> > > 
> > > Will add one. Generally the documentation on 'formatexpr' examples is a 
> > > bit sparse. So where should I put the documentation (and what should the 
> > > tag be called)?
> > 
> > Yes, we could use some better examples, also related to the filetype
> > plugin.  There is section 10.7 of the user manual, but that's not about
> > customizing.  We can add a link there.
> > 
> > The help at 'formatexpr' is already a bit long, not a good place to add
> > more.  Let's keep the technical explanation there, but link to a place
> > with examples.
> > 
> > Perhaps usr_43.txt is the best place.  Or just above ":help
> > right-justify".
> 
> I went for :h right-justify. 
> 
> However when playing around a bit with formatexpession in insert mode, I 
> had all kind of strange effects (non-undoable insertions below the 
> current line, kind of a recursive call of the function, etc) so I would 
> actually go so far to discourage calling the function in insert mode (or 
> at least mention that in insert mode the function should fall back to 
> Vims internal formatter by returning non-zero).
> 
> And in general it feels too limited to be called in insert mode for each 
> character inserted (since you have to be really careful not to overwrite 
> anything unwanted and it is a bit tricky to simply add a line break)
> 
> Also I think it is hardly possible to make an educated guess what the 
> user actually wants from the single character to be inserted.
> 
> I did not do it, because I was not sure, how you felt about it.
> 
> (Slightly updated xmlformat.vim file included as well).

Oh, I didn't mean to include an example of a function, but just when to
set 'formatexpr' to an existing function.  And where to do that.  I
would assume in most cases it would be done in the ftplugin file:

        :set formatexpr=xmlformat#Format()

With an explanation of how Vim finds the file that contains the function
in the autoload directory.

Fixing the problems in Insert mode is a different issue.


-- 
If "R" is Reverse, how come "D" is FORWARD?

 /// Bram Moolenaar -- b...@moolenaar.net -- 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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui