Then create a new cpp buffer, and type the following text:
for for1
for1
With the cursor at the end of the buffer (after the second for1), type <c-r>=MyComplete('for1',0). The pop-up menu will open below the first line. If the window view is saved and restored (see the commented lines above), the bug does not occur.
According to :h E839:
The function is allowed to move the cursor, it is restored afterwards.
Source this code:
Then create a new
cpp
buffer, and type the following text:With the cursor at the end of the buffer (after the second
for1
), type<c-r>=MyComplete('for1',0)
. The pop-up menu will open below the first line. If the window view is saved and restored (see the commented lines above), the bug does not occur.According to
:h E839
:but it seems that the cursor is not restored.