Hi!
I'm new to vim (vim7.2 on Ubuntu 8.04), please be patient w/ me.

The following is from the Help pages:
         
                "When doing keyword completion in insert mode |ins-completion|, 
and
        'ignorecase' is also on, the case of the match is adjusted depending
        on the typed text.  If the typed text contains a lowercase letter
        where the match has an upper case letter, the completed part is made
        lowercase.  If the typed text has no lowercase letters and the match
        has a lowercase letter where the typed text has an uppercase letter,
        and there is a letter before it, the completed part is made uppercase.
        With 'noinfercase' the match is used as-is."

But in reality, the case does NOT change!
Try the following:
----------------------------------------
" create an Omni-function
function! MyFunction(findstart, base)
        if a:findstart
                let line = getline('.')
                let start = col('.')-1
                while start > 0 && line[start-1] =~ '\a'
                        let start-=1
                endwhile
        return start
        else
                let res=split('lowercase UPPERCASE mixedCase')
                let res2=[]
                for m in res
                        if m =~ '^' .a:base
                                call add(res2, m)
                        endif
                endfor
                return res2
        endif
endfunction
set omnifunc=MyFunction

" set both options (ignorecase and infercase) per the help pages
set infercase
set ignorecase
-------------------------------
(end of script). http://old.nabble.com/file/p28837585/exmple exmple 

now when I invoke Omni-function - i_CTRL-X_CTRL-O - here are the results:
 
   Typing the string 'upper', then CTRL-X_CTRL-O, and CTRL-Y (to accept
completion), I get 'UPPERCASE'.
   Typing the string 'mixedC', then CTRL-X_CTRL-O, and CTRL-Y (to accept
completion), I get 'mixedCase'.
   Typing the string 'LOWER', then CTRL-X_CTRL-O, and CTRL-Y (to accept
completion), I get 'lowercase'.
 
i.e the case is still exactly the same as in the PopUpMenu, even though both
'infercase' and 'ignorecase' are set.

Please check the attached file for the above script.

Thank you so much in advance for looking into it.


-- 
View this message in context: 
http://old.nabble.com/Reality-Check%3A-%27infercase%27-option-not-working-per-documentation-tp28837585p28837585.html
Sent from the Vim - General mailing list archive at Nabble.com.

-- 
You received this message from the "vim_use" 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

Reply via email to