On Fri, Jan 16, 2015 at 02:45:49PM -0800, h_east wrote:
> Hi Bram and list,
> 
> I found a strange code.
> 
> ins_compl_bs() in src/edit.c : L3397
>  3393     /* Stop completion when the whole word was deleted.  For Omni 
> completion
>  3394      * allow the word to be deleted, we won't match everything. */
>  3395     if ((int)(p - line) - (int)compl_col < 0
>  3396             || ((int)(p - line) - (int)compl_col == 0
>  3397                 && (ctrl_x_mode & CTRL_X_OMNI) == 0))
>  3398         return K_BS;
> 
> 
> `ctrl_x_mode` is assigned a kind of serial number. (CTRL_X_~)
> But L3397 implemented a logical AND operation.
> I think this is code typo. 

The logical AND is applied to the result of the "(ctrl_x_mode &
CTRL_X_OMNI) == 0" expression.  That expression is checking whether
ctrl_x_mode is anything except CTRL_X_OMNI, i.e. whether the bitwise AND
of ctrl_x_mode and CTRL_X_OMNI share no common bits (== 0).

Your proposed patch has the same end result, but does make this code
more in line with most of the other uses of ctrl_x_mode in the file.

Cheers,
-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <[email protected]>

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

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui