Sung Pae wrote:
> The documentation explicitly states that moving the cursor is okay in
> an indentexpr, but this is only true when moved directly with cursor(),
> setpos(), search(), etc. Moving the cursor via `normal! w` has side
> effects that frustrate the attempts of get_expr_indent() to restore the
> original cursor position. However, this is not apparent without reading
> the source.
> For example:
> function! BadIndentExpr()
> normal! $
> return 8
> setlocal indentexpr=BadIndentExpr()
> The cursor position is not restored when indenting the current line.
I rather fix the problem than updating the documentation.
You say you read the source code, can you pinpoint why the cursor is not
restored when using :normal?
Men may not be seen publicly in any kind of strapless gown.
[real standing law in Florida, United States of America]
/// Bram Moolenaar -- Br...@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