zsh-autopair icon indicating copy to clipboard operation
zsh-autopair copied to clipboard

Keys that autopair use should be able to perform their original actions after this plugin loaded

Open kutsan opened this issue 8 years ago • 10 comments
trafficstars

zsh-autopair overrides some existing keys like ", ' and such. Those keys can't be used with their original behaviour after zsh-autopair sourced if users have existing widgets for that.

Recently, owner of this plugin added two fallback for ^? (Backspace) and (Space) keys but apparently more general solution needed.

kutsan avatar Oct 05 '17 12:10 kutsan

Alright, a more generalized solution is in place. Let me know if it gives you any trouble.

hlissner avatar Oct 05 '17 21:10 hlissner

Commit a01f07411dc44fe94142fac30cf36418f8d86456 introducing a new error. It breaks the zsh-syntax-highlighting plugin and its some features are not working correctly. Everything is okay under b486f0dbdae4b420538e5fd5fe45f5f7c77316f6.

By the way, your solution isn't working even if we ignore this error. I write bindkey -M viins '^?' vi-forward-char to my .zshrc for testing purposes, before sourcing zsh-autopair. It didn't work out.

kutsan avatar Oct 06 '17 11:10 kutsan

I found the problem and pushed a fix. Let me know if it gives you trouble!

hlissner avatar Oct 06 '17 11:10 hlissner

Well, I have still the same problem. I can confirm I am on e73053db1fef731e8001062b0a739dd20caed5fb.

kutsan avatar Oct 06 '17 12:10 kutsan

I don't want to derail the plugin development, but may the features be developed in separate branches, rather then in master?

z0rc avatar Oct 06 '17 16:10 z0rc

@z0rc I agree with that.

kutsan avatar Oct 06 '17 17:10 kutsan

Agreed. Sorry, should've done that from the start. I've effectively reset master to b0a995a and moved this feature to the widget-fallback branch (which I'll put up soon).

hlissner avatar Oct 06 '17 17:10 hlissner

Also, I wouldn't force push if I were you. Now, probably someone dealing with their weird looking git history and wondering what went wrong. There is safe alternative for that.

kutsan avatar Oct 06 '17 19:10 kutsan

I apologize for any trouble, but I understand the pitfalls. Also, --force-with-lease's selling point is it prevents overwriting "unpulled" commits on the remote. It wouldn't have made a difference here.

In any case, your feature is now in widget-fallbacks, could you try it out? If it doesn't work, would you also mind trying develop too? I haven't had much luck reproducing your past issues across several computers and docker images; I'd like to be certain.

hlissner avatar Oct 06 '17 23:10 hlissner

Okay here's my report with this lines in my config.

bindkey -M viins '^?' backward-kill-word
source "$ZDOTDIR/plugins/zsh-autopair/autopair.zsh"

In develop branch, everything is like that. My binding works but there is nothing left of autopair. Backspace always deletes word backwards. Whereas it should have deleted the last pair if there is one.

In widget-fallbacks branch, everything still looks the same like I said above. It breaks zsh-syntax-highlighting and binding doesn't work at all. autopair and its other features works though.

kutsan avatar Oct 07 '17 11:10 kutsan