Hi,

2016-3-8(Tue) 8:05:08 UTC+9 ZyX:
> 2016-03-08 1:33 GMT+03:00 Daniel Hahler <[email protected]>:
> 
> b:changedtick gets changed and triggers TextChangedI although there might be 
> no changes:
> 
> 
> vim -u NONE -N
> ifoo<Esc>
> 
> :echom b:changedtick
> => 5
> a<Esc>
> 
> :echom b:changedtick
> => 5  (OK)
> 
> a<C-p>
> => "-- Keyword completion (^N^P) Pattern not found"
> 
> <Esc>:echom b:changedtick
> => 11
> 
> 
> 
> Note that this is len("foo") * 2.
> 
> 
> This is likely caused by Vim replacing the word itself with itself 
> internally?!
> 
> 
> This is a bit problematic in the context of completions, because it will not 
> display the popup menu with completions, but might re-trigger e.g. deoplete 
> (which hooks into TextChangedI).
> 
> 
> I could not reproduce it using the following btw:
> 
> vim -u NONE --cmd 'norm ifoo' --cmd 'echom b:changedtick' --cmd 'call 
> feedkeys("a\<C-p>\<Esc>")' --cmd 'echom b:changedtick'
> 
> 
> 
> ​You cannot do this because you do not understand when `feedkeys()` are 
> processed. It *first* runs second `:echomsg b:changedtick` and *then* 
> processes `a<C-p><Esc>`. Use `normal` or write `:echomsg b:changedtick\n` 
> right after `\<Esc>`:

Not it if you specify the "x" to the second argument of the feedkeys().

document:
https://github.com/vim/vim/blob/master/runtime/doc/eval.txt#L3357-L3361

sample:
https://github.com/vim/vim/blob/master/src/testdir/test_packadd.vim#L77

--
Best regards,
Hirohito Higashi (a.k.a. h_east)

> 
> 
>     ​vim -u NONE --cmd 'call setline(1, "foo")' --cmd 'echom b:changedtick' 
> --cmd 'execute "normal!" "a\<C-p>\e"' --cmd 'echomsg b:changedtick' --cmd cq
> 
> 
> : this produces 3 (first changedtick), 9 (second changedtick) and a big 
> number of blank lines (normally printing messages and exiting in --cmd means 
> that Vim will exit before starting drawing the screen, so all messages go to 
> stderr, among other output *only* messages get to stderr and stdout, 
> including alternate screen not being used (Vim tells terminal to use 
> alternate screen by outputting special escape sequences, so it is “output to 
> stderr or stdout”)).
> 
>  
> 
> 
> 
> If this cannot be fixed internally to not change b:changedtick, it should at 
> least not trigger TextChangedI / TextChanged probably.
> 
> 
> /cc @Shougo (because I've noticed this in the context of deoplete; Neovim is 
> affected as well)

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