On 28/02/09 10:00, Dominique Pelle wrote:
> Dominique Pelle wrote:
>
>> John Little wrote:
>>
>>> On Feb 28, 6:53 am, Kenneth Reid Beesley wrote:
>>>
>>>> But  :help lCursor   returned no information.
>>> BTW, You could have tried
>>>
>>> :helpgrep lCursor
>>>
>>> Regards, John
>> Yes, ":helpgrep lCursor" gives a few hints.  But still,
>> lCursor deserves a tag I think to make ":help lCursor"
>> work. I did not know about lCursor until today, it's useful.
>>
>> I wonder whether this is a bug though:
>>
>> $ gvim -u NONE -U NONE
>>
>> :hi Cursor guibg=#ff0000           " red cursor
>> :hi lCursor guibg=#00ff00          " green cursor when keymap activated
>>
>> :set imcursor?
>>   iminsert=2            " OK, expected
>>
>> :set keymap=esperanto   " or any other keymap
>> :set iminsert?
>>   iminsert=1            " OK, expected
>>
>> :set keymap=
>> :set iminsert?
>>   iminsert=1            " Hmmm, shouldn't this be back to 2???
>>
>> lCursor is nice so that cursor color changes aspect when a
>> keymap is being activated. But if I cancel the keymap with
>> ":set keymap=" then cursor remains in the same color
>> (green, lCursor) as if there was still a keymap activated.
>> It seems to me that the cursor should then become red
>> (Cursor).  I can work around with ":set imcursor=2" which
>> puts back the cursor in red (Cursor).
>>
>> In ":help iminsert" I see:
>>
>>         Specifies whether :lmap or an Input Method (IM) is to be used in
>>         Insert mode.  Valid values:
>>                 0       :lmap is off and IM is off
>>                 1       :lmap is ON and IM is off
>>                 2       :lmap is off and IM is ON
>>
>> I'm using vim-7.2.127 (huge), GUI GTK2 on Linux x86.
>>
>> -- Dominique
>
>
> Attached patch fixes the problem I described in my previous
> email: it makes the cursor go back to normal color (Cursor
> instead of lCursor) when cancelling keymaps with ":set keymap=".
>
> Please review it since I must admit I don't fully understand
> how 'iminsert' and 'imsearch' are supposed to work...
>
> Regards
> -- Dominique

With no patch, just use

        :setlocal keymap= imi=0

and the cursor will go back to Cursor.

Currently, setting 'keymap' to something also sets 'iminsert' to 1 but 
setting 'keymap' to empty doesn't automagically set 'iminsert' to zero. 
Similarly, I think there is an interaction between using an Input Method 
(XIM or Windows IME) and setting 'imi' to 2 but I don't know the details.

Warning: a future patch issued by Bram is currently being tested (by me 
and possibly by others) about setting 'iminsert' locally and not 
globally when using ":setlocal keymap=keymapname". It has been published 
in an email by Bram with Subject "Re: Bug? Keymaps (when set by menu) 
and 'iminsert' (when set implicitly by setting 'keymap') are set 
globally", sent to vim_dev list and dated "Thu, 26 Feb 2009 04:21:36 +0100".


Best regards,
Tony.
-- 
SIGIRO -- too much irony (core dumped)

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

Reply via email to