Hi TheLonelyStar!

On Do, 09 Jul 2009, TheLonelyStar wrote:

> I have a my tab key mapped to a function which should react 
> different depending on the situation

> 1. If I am in a comment, the current word is completet from dictonary
> 2. If I am in code, curstom completions is called (elim sits behind it here)
> Now I want a third thing:
> 3. If I am in a comment and the current word is misspelled, spell correct
> it.
> 
> The function works for the first 2 things, but the last thing I do not know
> how to do:
> This is the function:
> 

I have never used spellbadword() but this works for me:

fu! Spell()                                                                     
     let badword = spellbadword(expand("<cword>"))
     if badword == [ '', '']                                                    
              echo "Current word is good"
     else                                                                       
         echo "Found: " . badword[0] . " Type: " . badword[1]                   
     endif                                                                      
endfu                        

Hope that helps.

regards,
Christian
-- 
:wq!

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to