On Mi, 08 Aug 2018, Bram Moolenaar wrote:

> Patch 8.1.0256 (after 8.1.0245)
> Problem:    Using setline() in TextChangedI splits undo.
> Solution:   Use another solution for undo not working properly.
> Files:            src/edit.c, src/testdir/test_autocmd.vim
> 
> --- 1721,1736 ----
>           )
>       {
>       aco_save_T      aco;
> !     varnumber_T     tick = CHANGEDTICK(curbuf);
>   
>       // save and restore curwin and curbuf, in case the autocmd changes them
>       aucmd_prepbuf(&aco, curbuf);
>       apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf);
>       aucmd_restbuf(&aco);

Is there a reason for not using `ins_apply_autocmds(EVENT_TEXTCHANGEDI);` here?
Perhaps because of aucmd_prepbuf/aucmd_restbuf? So perhaps move those 
calls into ins_apply_autocmds() as well?
Also for EVENT_TEXTCHANGEDP further below.

>       curbuf->b_last_changedtick = CHANGEDTICK(curbuf);
> !     if (tick != CHANGEDTICK(curbuf))  // see ins_apply_autocmds()
> !         u_save(curwin->w_cursor.lnum,
> !                                     (linenr_T)(curwin->w_cursor.lnum + 1));
>       }

Best,
Christian
-- 
Wir wissen von keiner Welt, als im Bezug auf den Menschen; wir 
wollen keine Kunst, als die ein Abdruck dieses Bezugs ist.
                -- Goethe, Maximen und Reflektionen, Nr. 1130

-- 
-- 
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.

Raspunde prin e-mail lui