Hi Bram,

2015/2/18(Wed) 1:26:32 UTC+9 Bram Moolenaar:
> Hirohito Higashi wrote:
> 
> > 2015/2/9(Mon) 2:21:55 UTC+9 h_east:
> > > Hi Bram and Nice Vim developers,
> > > 
> > > 2015/1/6(Tue) 4:58:27 UTC+9 Bram Moolenaar:
> > > > Yasuhiro Matsumoto wrote:
> > > > 
> > > > > bug.vim
> > > > > -------------------
> > > > > set nocompatible
> > > > > 
> > > > > inoremap <F5> <C-R>=ListMonths()<CR>
> > > > > 
> > > > > func! ListMonths()
> > > > >   call complete(col('.'), ['January', 'February', 'March',
> > > > >         \ 'April', 'May', 'June', 'July', 'August', 'September',
> > > > >         \ 'October', 'November', 'December'])
> > > > >   return ''
> > > > > endfunc
> > > > > -------------------
> > > > > 
> > > > > 1. vim -u bug.vim -N
> > > > > 
> > > > > 2. press F5
> > > > > 
> > > > > 3. type Ctrl-L while popup menu is visible
> > > > > 
> > > > > Ctrl-L should not behave like Ctrl-P. ins_compl_key2dir() handles
> > > > > suffix keys after CTRL-X. And also it handles keys while popup menu is
> > > > > visible (ex: CTRL-P/CTRL-N). This should be cleanly separated.
> > > > > 
> > > > > https://gist.github.com/mattn/2c83d5a17c9e9505e43d
> > > > 
> > > > Thanks!
> > > 
> > > I update a patch. (Attached to this email)
> > > Please check.
> > 
> > Oops. My previous patch had a problem. so I attached a new patch.
> > Please check.
> 
> Thanks for the update.
> 
> > > And ...
> > > I found specification inconsistency between 'complete()' and 'backspace' 
> > > option.
> > > 
> > > How to reproduce:
> > > 1. cat test.vim
> > >   inoremap <F5> <C-R>=ListMonths()<CR>
> > > 
> > >   func! ListMonths()
> > >     call complete(1, ['One', 'Three'])
> > >     return ''
> > >   endfunc
> > > 
> > > 2. vim -N -u test.vim
> > > 
> > > 3. Enter insert-mode and input 'ab' and leave insert-mode.
> > >   iab<Esc>
> > > 
> > > 4. Reenter insert-mode and use 'complete()'
> > >   a<F5>
> > > 
> > > 5. Delete two characters.
> > >   <C-H><C-H>
> > > 
> > > What happen.
> > > - '4.' Edit start columns 3, but 'complete()' starts 1 (by 1st argument).
> > > - '5.' Can't delete column 1 and 2
> > >   'backspace' option not contain "start", So vim can not deleted this.
> > > 
> > > I think this is specification inconsistency.
> > > How Let's fix?
> > > (a) Occurred an error when 'complete()' first argument is can not be 
> > > deleted by under the influence of the 'backspace' option.
> > > 
> > > (b) Adjust the first argument value implicitly in f_complete(). (In this 
> > > case, Ajust 3)
> > > 
> > > (c) Between 'complete()' is functioning to ignore the 'backspace' option.
> > > 
> > > I would write the patch when you are determined.
> > 
> > Bram, Please decide a specification.
> 
> The 'backspace' option should probably be ignored in this situation,
> since the code says to change those characters.  'backspace' is really
> to make Vim backwards compatible with Vi, for those users who prefer it
> that way.  I don't think it should apply to Insert mode completion.

Thanks for the reply.
I was convinced to your opinion. But thinking has changed to one that is by 
analyzing the source code in order to write a patch.
Because, The completion mode has been finished(*1) before function ins_bs() is 
called When I first press the <C-H> key at reproduce step '5.'.

  *1: ins_compl_active() returns 0 and ctrl_x_mode is 0. 

Therefore, it is impossible to determination of whether a complementing in 
ins_bs().

So, the specification I'd be in (a) or (b).
What do you think?

Best regards,
Hirohito Higashi (a.k.a h_east)

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

Raspunde prin e-mail lui