Hi Raymond!

On Mi, 20 Jun 2012, Raymond Ko wrote:

> This patch breaks the dot register for my autocompletion plugin when
> 'refresh: always' is NOT set. Once the popup menu shows up, any
> following character is appended twice to the dot register. Although I
> can work around it by setting 'refresh: always' (my plugin is not
> dependent on this), I'm sure there is an underlying bug with the code.
> 
> Attached is a minimal test case based off of my plugin to reproduce
> the bug. My results are marked on the comments of the return clause
> inside the completion function. It is also available on:
> 
> https://gist.github.com/2960778
> 
> Steps to reproduce: 1. Run "C:\Program Files (x86)\Vim\vim73\gvim.exe"
> -u NONE -i NONE 2. :source test.vim 3. Enter insert mode 4. Type test
> 5. <ESC> 6. :reg(.)
> 
> My original plugin is at:
> https://github.com/raymond-w-ko/omegacomplete.vim for any interested
> as to why I am doing this. Note that it is still a work in progress.


So only add to the redo buffer, when refresh:always is set, right?

diff --git a/src/edit.c b/src/edit.c
--- a/src/edit.c
+++ b/src/edit.c
@@ -3467,13 +3467,15 @@
        (*mb_char2bytes)(c, buf);
        buf[cc] = NUL;
        ins_char_bytes(buf, cc);
-       AppendToRedobuff(buf);
+       if (compl_opt_refresh_always)
+           AppendToRedobuff(buf);
     }
     else
 #endif
     {
        ins_char(c);
-       AppendCharToRedobuff(c);
+       if (compl_opt_refresh_always)
+           AppendCharToRedobuff(c);
     }
 
     /* If we didn't complete finding matches we must search again. */


regards,
Christian
-- 

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

Raspunde prin e-mail lui