Re: Using py commands to evaluate text for balloon commands for web lookups.
- I got my balloon function to do WEB lookups of word under mouse,
on wiki/google/dictionary via python.
However for couple of issues I am stuck with (any help appreciated):
1. The gvim freezes (cursor stop blinking for 3 seconds) while
python is doing web lookups. Can I run this lookup as a thread in
2. The python lookup throws errors messages when lookup receives bad html;
which I could NOT catch with 'python/try' and in 'vim/try' blocks.
It looks ugly on the message bar.
3. I want to clear the Balloon text on a lookup error, instead of
displaying stale results.
Can I clear reset the Balloon value before starting a lookup?
Because the Balloon interface only uses the return value of my function.
4. Any function to pick phrase under mouse?
thanks for the earlier help (I used eval to interface with python).
On 5/24/06, Ilya <ilya@...> wrote:
> Mohsin wrote:
> > I am trying to use the ':py' interface to evaluate text under cursor
> > and show
> > the result in a balloon text. I got the python and vim code to work
> > easily,
> > however I have problem communicating between the two (py and vim):
> > 1. How do I access vim variables in py commands
> > (like text under cursor, all the 'let variables', 'set options')?
> > [...]
> Maybe this thread could be helpful, they are talking about vim.eval()
> function and looks like it could be used to get variable values, even