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:
>
> 1. vim -u NONE -N
> 2. ifoo<Esc>
> 3. :echom b:changedtick => 5
> 4. a<Esc>
> 5. :echom b:changedtick => 5 (OK)
> 6. a<C-p> => "-- Keyword completion (^N^P) Pattern not found"
> 7. <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>`:
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 <https://github.com/Shougo> (because I've noticed this in the
> context of deoplete; Neovim is affected as well)
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/vim/vim/issues/679>.
>
> --
> --
> 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.
>
--
--
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.