Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bug: zsh vim textobjects and slash



If I may raise another issue with VIM mode: In insert mode, delete using
backspace has a strange behavior.
Example:
I type 'kubectl get pods', and want to delete the word 'get'. in normal
mode I move the cursor to right after the word 'get', then 'i' for insert
mode and and press backspace - doesn't work. while still in insert mode, I
move the cursor using the arrows forward (into the word 'pods') - backspace
works up until the point where I entered insert mode (so still can't delete
'get').
One would guess that the bug is that insert only makes the text after the
cursor editable, but no: while still in insert mode, move the cursor to
anywhere before the place where entered insert mode (somewhere in 'kubectl
get') and make any addition, like add a single char - now backspace works
everywhere and I can delete even the word 'get').

On Fri, May 18, 2018 at 8:51 PM Itay Shakury <itaysk@xxxxxxxxxxxx> wrote:

> > I think this has been fixed in a6135f6 (41191) which is in zsh 5.4.
>
> THANKS! Confirmed working in 5.5.1
>
> On Fri, May 18, 2018 at 3:26 PM Oliver Kiddle <okiddle@xxxxxxxxxxx> wrote:
>
>> Itay Shakury wrote:
>> > Example: if I'm typing `ls /var/lib/docker` and want to change 'lib' to
>> > 'run', I would place the cursor in the 'lib' word, and do `ciw`. In vim
>> > this would delete the 'lib' word and put me in insert mode. In zsh it
>> > deletes the entire path ('var/lib/docker').
>>
>> This bug doesn't occur with a default zsh setup. I do, however, have
>> a theory as to the cause. I suspect that you are using a plugin that
>> redefines every zle widget (every key in effect).
>> zsh-syntax-highlighting perhaps?
>>
>> If you do "bindkey -M viopp iw", you should see:
>>   "iw" select-in-word
>> And if you do "zle -lL select-in-word", you should get nothing. If you
>> do get something, it is likely that select-in-word has been redefined.
>>
>> The trouble is that internally, one function handles all of iw, iW, aw
>> and aW. It is checking whether the invoked widget is select-in-word. But
>> if you've redefined that, the check returns false and you get iW
>> (select-in-blank-word) behaviour.
>>
>> I think this has been fixed in a6135f6 (41191) which is in zsh 5.4.
>>
>> I'm not quite sure of how to remove the custom select-in-word widget
>> other than by disabling the entire plugin. zle -D select-in-word seems
>> to cause other problems. If I run that after sourcing
>> zsh-syntax-highlighting, I can get a seg fault, including with 5.5.
>>
>> Oliver
>>
>


Messages sorted by: Reverse Date, Date, Thread, Author