On Monday, July 14, 2014 1:25:32 PM UTC-7, Jacob Niehus wrote:
> On Sunday, July 13, 2014 2:20:04 PM UTC-7, Bram Moolenaar wrote:
> > Jacob Niehus wrote:
> >
> >
> >
> > > On Sunday, July 6, 2014 5:23:39 PM UTC-7, Jacob Niehus wrote:
> >
> > > > After patch 7.4.314, I've had characters that I hadn't typed stay on
> > > > screen even though they aren't really there and they go away after
> > > > exiting insert mode. I am using NeoComplete in Vim 7.4 with patches
> > > > 1-347. The attached patch fixes the problem without affecting the
> > > > feature introduced in patch 7.4.314. See also attached screenshots
> > > > showing the current line in insert mode and then the same line after
> > > > pressing escape. That problem happens in the current version of Vim but
> > > > not after my change.
> >
> > > >
> >
> > > > I am seeing this problem in Cygwin (Windows 7) in both mintty and
> > > > XTerm. My Cygwin version is:
> >
> > > > CYGWIN_NT-6.1-WOW64 1.7.30(0.272/5/3) 2014-05-23 10:36
> >
> > > >
> >
> > > > Here is my Vim version information:
> >
> > [...]
> >
> >
> >
> > > Bram,
> >
> > >
> >
> > > On further thought I don't think this patch should be included. It's a
> >
> > > bad workaround and I have seen the completion messages pop up
> >
> > > occasionally since using it. I'll try and find a better solution.
> >
> >
> >
> > It was already included as patch 7.4.357. I suppose it's not necessary
> >
> > to roll it back. But if you have a better solution that is welcome.
> >
> >
> >
> > --
> >
> > Close your shells, or I'll kill -9 you
> >
> > Tomorrow I'll quota you
> >
> > Remember the disks'll always be full
> >
> > And then while I'm away
> >
> > I'll write ~ everyday
> >
> > And I'll send-pr all my buggings to you.
> >
> > [ CVS log "Beatles style" for FreeBSD ports/INDEX, Satoshi Asami ]
> >
> >
> >
> > /// Bram Moolenaar -- [email protected] -- 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 ///
>
> Bram,
>
> I've come up with two ways to fix it, but I'm not sure either is acceptable.
> When I submit this patch, I will roll back the change because Shougo wrote
> that the way he did to prevent "-- INSERT --" from flickering during
> completion, which my change broken.
>
> I think the problem is that the ins_compl_delete() function calls
> changed_cline_bef_curs(), but the line is also changed after the cursor
> because that's where the completion candidate was, so it's getting left
> there. Actually even exiting insert mode does not clear the remaining
> characters - that only worked because I had 'set cursorline' on InsertLeave.
> I can redraw the line using update_screen(CLEAR) or screen_fill(), and the
> latter is probably faster, but is there a more straightforward way of
> redrawing the portion of the line after the cursor that I haven't found? If
> not, I'll submit a patch using screen_fill.
>
> Thanks,
> Jake
Bram,
Resetting the cursor after deleting the completion candidate does the trick.
Tested in Cygwin and OS X.
-Jake
diff --git a/src/edit.c b/src/edit.c
--- a/src/edit.c
+++ b/src/edit.c
@@ -3854,7 +3854,8 @@
ins_compl_free();
compl_started = FALSE;
compl_matches = 0;
- msg_clr_cmdline(); /* necessary for "noshowmode" */
+ if (!shortmess(SHM_COMPLETIONMENU))
+ msg_clr_cmdline(); /* necessary for "noshowmode" */
ctrl_x_mode = 0;
compl_enter_selects = FALSE;
if (edit_submode != NULL)
@@ -4592,6 +4593,8 @@
i = compl_col + (compl_cont_status & CONT_ADDING ? compl_length : 0);
backspace_until_column(i);
changed_cline_bef_curs();
+ /* Clean up deleted characters */
+ screen_start();
}
/* Insert the new text being completed. */
--
--
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.
diff --git a/src/edit.c b/src/edit.c
--- a/src/edit.c
+++ b/src/edit.c
@@ -3854,7 +3854,8 @@
ins_compl_free();
compl_started = FALSE;
compl_matches = 0;
- msg_clr_cmdline(); /* necessary for "noshowmode" */
+ if (!shortmess(SHM_COMPLETIONMENU))
+ msg_clr_cmdline(); /* necessary for "noshowmode" */
ctrl_x_mode = 0;
compl_enter_selects = FALSE;
if (edit_submode != NULL)
@@ -4592,6 +4593,8 @@
i = compl_col + (compl_cont_status & CONT_ADDING ? compl_length : 0);
backspace_until_column(i);
changed_cline_bef_curs();
+ /* Clean up deleted characters */
+ screen_start();
}
/* Insert the new text being completed. */