[vim/vim] VIM 7.4: Possible regression via patch 2146? (#972)

69 views
Skip to first unread message

Jaren Stangret

unread,
Aug 8, 2016, 1:59:21 PM8/8/16
to vim/vim

Hello,

With patch 2146 (4724728), text may be inserted while backspacing or typing if you have configured VIM to automatically display a popup menu with possible completions. This is most noticeable when trying to backspace on a word that has a possible match.

Using vim -u NONE alleviates this use, but that would be expected.

I'm currently using ACP to handle autocompletion.

Using the below patch fixes/reverts the issue (on HEAD) for me:

diff --git a/src/edit.c b/src/edit.c
index 6dae4a0..2281232 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -3893,7 +3893,7 @@ ins_compl_prep(int c)

            /* CTRL-E means completion is Ended, go back to the typed text.
             * but only do this, if the Popup is still visible */
-           if (c == Ctrl_E && pum_visible())
+           if (c == Ctrl_E)
            {
                ins_compl_delete();

Hopefully someone can shed some insight on this. I'm unsure if it's a bug in VIM or the plugins implementation of the VIM popup via ACP.

Below is the git bisect where I traced from patch 1051(af8af8b) to patch 2181(a772ec5):

git bisect start
# good: [af8af8bfac5792fa64efbc524032d568cc7754f7] patch 7.4.1051 Problem:    Segfault when unletting "count". Solution:   Check for readonly and locked first. (Dominique Pelle)             Add a test.
git bisect good af8af8bfac5792fa64efbc524032d568cc7754f7
# bad: [a772ec5e91efbd5c4b99bb5cf5704a6c6f0baf3f] patch 7.4.2181 Problem:    Compiler warning for unused variable. Solution:   Remove it. (Dominique Pelle)
git bisect bad a772ec5e91efbd5c4b99bb5cf5704a6c6f0baf3f
# good: [a4f6ca717b4483eb82c6c71f71a5a5cf70e55d80] patch 7.4.1618 Problem:    Starting job with output to buffer changes options in the current             buffer. Solution:   Set "curbuf" earlier. (Yasuhiro Matsumoto)
git bisect good a4f6ca717b4483eb82c6c71f71a5a5cf70e55d80
# good: [28b942a064dd486cc241894b625ab72f5a5c6d1b] patch 7.4.1900 Problem:    Using CTRL-] in the help on "{address}." doesn't work. Solution:   Recognize an item in {}. (Hirohito Higashi, closes #814)
git bisect good 28b942a064dd486cc241894b625ab72f5a5c6d1b
# good: [93431df9eb02f7cf3d7f2142bb1bef24c5f325b2] patch 7.4.2043 Problem:    setbuvfar() causes a screen redraw. Solution:   Only use aucmd_prepbuf() for options.
git bisect good 93431df9eb02f7cf3d7f2142bb1bef24c5f325b2
# good: [ad9c2a08f0509294269a2f11a59a438b944bdd5a] patch 7.4.2109 Problem:    Setting 'display' to "lastline" is a drastic change, while             omitting it results in lots of "@" lines. Solution:   Add "truncate" to show "@@@" for a truncated line.
git bisect good ad9c2a08f0509294269a2f11a59a438b944bdd5a
# good: [bc8801c9317eb721a2ee91322669f2dd5d136380] Updated runtime files.
git bisect good bc8801c9317eb721a2ee91322669f2dd5d136380
# bad: [7522f6982197f83a5c0f6e9af07fb713934f824a] patch 7.4.2162 Problem:    Result of getcompletion('', 'sign') depends on previous             completion. Solution:   Call set_context_in_sign_cmd(). (Dominique Pelle)
git bisect bad 7522f6982197f83a5c0f6e9af07fb713934f824a
# bad: [ee695f787ade7fd88fc5f5497553d95c0c3645b5] patch 7.4.2152 Problem:    No proper translation of messages with a count. Solution:   Use ngettext(). (Sergey Alyoshin)
git bisect bad ee695f787ade7fd88fc5f5497553d95c0c3645b5
# bad: [abb71fbd399772d467aaa7b34b958b0f975c7e65] patch 7.4.2147 Problem:    test_alot fails. Solution:   Close window.
git bisect bad abb71fbd399772d467aaa7b34b958b0f975c7e65
# good: [86f2cd5bc574c23fa276d7f57cd1300e24222913] patch 7.4.2145 Problem:    Win32: Using CreateThread/ExitThread is not safe. Solution:   Use _beginthreadex and return from the thread. (Ken Takata)
git bisect good 86f2cd5bc574c23fa276d7f57cd1300e24222913
# bad: [472472898ab71ac80a86fedc37f8eb91461788dd] patch 7.4.2146 Problem:    Not enough testing for popup menu.  CTRL-E does not always work             properly. Solution:   Add more tests.  When using CTRL-E check if the popup menu is             visible. (Christian Brabandt)
git bisect bad 472472898ab71ac80a86fedc37f8eb91461788dd
# first bad commit: [472472898ab71ac80a86fedc37f8eb91461788dd] patch 7.4.2146 Problem:    Not enough testing for popup menu.  CTRL-E does not always work             properly. Solution:   Add more tests.  When using CTRL-E check if the popup menu is             visible. (Christian Brabandt)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, .

manuelschi...@googlemail.com

unread,
Aug 9, 2016, 8:02:32 AM8/9/16
to vim_dev, v...@noreply.github.com, reply+00b1d198fb347e50d9b2f16d57284140ed56680...@reply.github.com, vim-dev...@256bit.org
On Monday, 8 August 2016 19:59:21 UTC+2, Jaren Stangret wrote:
> Hello,
>
>
> With patch 2146 (4724728), text may be inserted while backspacing or typing if you have configured VIM to automatically display a popup menu with possible completions. This is most noticeable when trying to backspace on a word that has a possible match.
>
>
> Using vim -u NONE alleviates this use, but that would be expected.
>
>
> I'm currently using ACP to handle autocompletion.

Hi,

I think I'm seeing the same thing (with YouCompleteMe). The behaviour is really strange: some completion gets appended to what I type without me actually selecting it, and I sometimes cannot even backspace over it because it seems to keep appending more than one characte for a single press of backspace key press. Reverting patch 2146 seems to cure the issue for me, too. Not sure if that helps anybody in tracking it down.

Manuel

vim-dev ML

unread,
Aug 9, 2016, 8:03:10 AM8/9/16
to vim/vim, vim-dev ML, Your activity
On Monday, 8 August 2016 19:59:21 UTC+2, Jaren Stangret wrote:
> Hello,
>
>
> With patch 2146 (4724728), text may be inserted while backspacing or typing if you have configured VIM to automatically display a popup menu with possible completions. This is most noticeable when trying to backspace on a word that has a possible match.
>
>
> Using vim -u NONE alleviates this use, but that would be expected.
>
>
> I'm currently using ACP to handle autocompletion.

Hi,

I think I'm seeing the same thing (with YouCompleteMe). The behaviour is really strange: some completion gets appended to what I type without me actually selecting it, and I sometimes cannot even backspace over it because it seems to keep appending more than one characte for a single press of backspace key press. Reverting patch 2146 seems to cure the issue for me, too.. Not sure if that helps anybody in tracking it down.

Manuel

> Using the below patch fixes/reverts the issue (on HEAD) for me:
>
> diff --git a/src/edit.c b/src/edit.c
> index 6dae4a0..2281232 100644
> --- a/src/edit.c
> +++ b/src/edit.c
> @@ -3893,7 +3893,7 @@ ins_compl_prep(int c)
>
> /* CTRL-E means completion is Ended, go back to the typed text.
> * but only do this, if the Popup is still visible */
> - if (c == Ctrl_E && pum_visible())
> + if (c == Ctrl_E)
> {
> ins_compl_delete();
>
>
>
>
> Hopefully someone can shed some insight on this. I'm unsure if it's a bug in VIM or the plugins implementation of the VIM popup via ACP.
>
>
> Below is the git bisect where I traced from patch 1051(af8af8b) to patch 2181(a772ec5):
>
> git bisect start
> # good: [af8af8bfac5792fa64efbc524032d568cc7754f7] patch 7.4.1051 Problem: Segfault when unletting "count". Solution: Check for readonly and locked first. (Dominique Pelle) Add a test.
> git bisect good af8af8bfac5792fa64efbc524032d568cc7754f7
> # bad: [a772ec5e91efbd5c4b99bb5cf5704a6c6f0baf3f] patch 7.4.2181 Problem: Compiler warning for unused variable. Solution: Remove it. (Dominique Pelle)
> git bisect bad a772ec5e91efbd5c4b99bb5cf5704a6c6f0baf3f
> # good: [a4f6ca717b4483eb82c6c71f71a5a5cf70e55d80] patch 7.4.1618 Problem: Starting job with output to buffer changes options in the current buffer. Solution: Set "curbuf" earlier. (Yasuhiro Matsumoto)
> git bisect good a4f6ca717b4483eb82c6c71f71a5a5cf70e55d80
> # good: [28b942a064dd486cc241894b625ab72f5a5c6d1b] patch 7.4.1900 Problem: Using CTRL-] in the help on "{address}." doesn't work.. Solution: Recognize an item in {}. (Hirohito Higashi, closes #814)

> git bisect good 28b942a064dd486cc241894b625ab72f5a5c6d1b
> # good: [93431df9eb02f7cf3d7f2142bb1bef24c5f325b2] patch 7.4.2043 Problem: setbuvfar() causes a screen redraw. Solution: Only use aucmd_prepbuf() for options.
> git bisect good 93431df9eb02f7cf3d7f2142bb1bef24c5f325b2
> # good: [ad9c2a08f0509294269a2f11a59a438b944bdd5a] patch 7.4.2109 Problem: Setting 'display' to "lastline" is a drastic change, while omitting it results in lots of "@" lines. Solution: Add "truncate" to show "@@@" for a truncated line.
> git bisect good ad9c2a08f0509294269a2f11a59a438b944bdd5a
> # good: [bc8801c9317eb721a2ee91322669f2dd5d136380] Updated runtime files.
> git bisect good bc8801c9317eb721a2ee91322669f2dd5d136380
> # bad: [7522f6982197f83a5c0f6e9af07fb713934f824a] patch 7.4.2162 Problem: Result of getcompletion('', 'sign') depends on previous completion. Solution: Call set_context_in_sign_cmd(). (Dominique Pelle)
> git bisect bad 7522f6982197f83a5c0f6e9af07fb713934f824a
> # bad: [ee695f787ade7fd88fc5f5497553d95c0c3645b5] patch 7.4.2152 Problem: No proper translation of messages with a count. Solution: Use ngettext(). (Sergey Alyoshin)
> git bisect bad ee695f787ade7fd88fc5f5497553d95c0c3645b5
> # bad: [abb71fbd399772d467aaa7b34b958b0f975c7e65] patch 7.4.2147 Problem: test_alot fails. Solution: Close window.
> git bisect bad abb71fbd399772d467aaa7b34b958b0f975c7e65
> # good: [86f2cd5bc574c23fa276d7f57cd1300e24222913] patch 7.4.2145 Problem: Win32: Using CreateThread/ExitThread is not safe. Solution: Use _beginthreadex and return from the thread. (Ken Takata)
> git bisect good 86f2cd5bc574c23fa276d7f57cd1300e24222913
> # bad: [472472898ab71ac80a86fedc37f8eb91461788dd] patch 7.4.2146 Problem: Not enough testing for popup menu. CTRL-E does not always work properly. Solution: Add more tests. When using CTRL-E check if the popup menu is visible. (Christian Brabandt)
> git bisect bad 472472898ab71ac80a86fedc37f8eb91461788dd
> # first bad commit: [472472898ab71ac80a86fedc37f8eb91461788dd] patch 7..4.2146 Problem: Not enough testing for popup menu. CTRL-E does not always work properly. Solution: Add more tests. When using CTRL-E check if the popup menu is visible. (Christian Brabandt)

>
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub, .


You are receiving this because you are subscribed to this thread.

Reply to this email directly, view it on GitHub, or mute the thread.

Bram Moolenaar

unread,
Aug 9, 2016, 3:52:22 PM8/9/16
to vim/vim, vim-dev ML, Comment

Closed #972 via c9fb77c.


You are receiving this because you commented.

Bram Moolenaar

unread,
Aug 9, 2016, 3:52:42 PM8/9/16
to vim/vim, vim-dev ML, Comment

Jaren Stangret wrote:

> With patch 2146 (472472898ab71ac80a86fedc37f8eb91461788dd), text may

> be inserted while backspacing or typing if you have configured VIM to
> automatically display a popup menu with possible completions. This is
> most noticeable when trying to backspace on a word that has a possible
> match.
>
> Using `vim -u NONE` alleviates this use, but that would be expected.
>
> I'm currently using [ACP](http://www.vim.org/scripts/script.php?script_id=1879) to handle autocompletion.

>
> Using the below patch fixes/reverts the issue (on HEAD) for me:
> <pre>diff --git a/src/edit.c b/src/edit.c

> index 6dae4a0..2281232 100644
> --- a/src/edit.c
> +++ b/src/edit.c
> @@ -3893,7 +3893,7 @@ ins_compl_prep(int c)
>
> /* CTRL-E means completion is Ended, go back to the typed text.
> * but only do this, if the Popup is still visible */
> - if (c == Ctrl_E && pum_visible())
> + if (c == Ctrl_E)
> {
> ins_compl_delete();
>
> </pre>

>
> Hopefully someone can shed some insight on this. I'm unsure if it's a
> bug in VIM or the plugins implementation of the VIM popup via ACP.

The insert completion code is very complex. I don't see an alternative
to rolling back the change. Also requires disabling one test case.

--
It doesn't really matter what you are able to do if you don't do it.
(Bram Moolenaar)

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


You are receiving this because you commented.

Jaren Stangret

unread,
Aug 9, 2016, 5:44:20 PM8/9/16
to vim/vim, vim-dev ML, Comment

Thank you for the fix!


You are receiving this because you commented.

vim-dev ML

unread,
Aug 21, 2016, 4:27:26 PM8/21/16
to vim/vim, vim-dev ML, Your activity
On Mo, 08 Aug 2016, Jaren Stangret wrote:

> Hello,
>
> With patch 2146 (472472898ab71ac80a86fedc37f8eb91461788dd), text may be inserted while backspacing or typing if you have configured VIM to automatically display a popup menu with possible completions. This is most noticeable when trying to backspace on a word that has a possible match.

>
> Using `vim -u NONE` alleviates this use, but that would be expected.
>
> I'm currently using [ACP](http://www.vim.org/scripts/script.php?script_id=1879) to handle autocompletion.

>
> Using the below patch fixes/reverts the issue (on HEAD) for me:
> <pre>diff --git a/src/edit.c b/src/edit.c

> index 6dae4a0..2281232 100644
> --- a/src/edit.c
> +++ b/src/edit.c
> @@ -3893,7 +3893,7 @@ ins_compl_prep(int c)
>
> /* CTRL-E means completion is Ended, go back to the typed text.
> * but only do this, if the Popup is still visible */
> - if (c == Ctrl_E && pum_visible())
> + if (c == Ctrl_E)
> {
> ins_compl_delete();
>
> </pre>

I still think, that patch 2146 is the correct way to fix Ctrl-E in popup
menu mode. I would like to further investigate the problem. Can you tell
me an exact way to reproduce the problem? Is it reproducible without any
plugin? Further, I don't understand, why this happens on Backspacing...

Best,
Christian
--
Letzte Worte eines Machos:
"Hallo Süße, wie wär's mit uns beiden?"


You are receiving this because you are subscribed to this thread.

Reply all
Reply to author
Forward
0 new messages