atlas-engineer / nyxt

Nyxt - the hacker's browser.
https://nyxt-browser.com/
9.78k stars 409 forks source link

Exiting `vi-insert-mode` when `passthrough-mode` is enabled #1697

Open whirm opened 3 years ago

whirm commented 3 years ago

Currently when application-mode is set to be enabled when entering insert-mode, one has to first exit application-mode with C-z and then exit insert-mode with Esc.

I got confused for a moment by unexpectedly being unable to exit insert-mode. I think it would be more user friendly if Esc was mapped to disabling both application-mode and insert-mode when application-mode-p is t.

Cheers!

Ambrevar commented 3 years ago

It's a pickle, because this would prevent us from sending Esc to the web view.

Which one is more used?

And... I'm just realizing that C-z is undo in CUA, so we are blocking that by binding C-z as well :)

Maybe we should just bind Esc then, and have a special binding to send Esc.

whirm commented 3 years ago

Esc could be temporarily mapped by vi-insert-mode right before enabling application-mode and unmapped when you trigger it so that if you enable application-mode normally Esc still gets passed through.

I guess Nyxt needs an emacs' (quoted-insert) analog :)

Ambrevar commented 3 years ago

Yup, quoted-insert would be very much needed!

aadcg commented 10 months ago

Application mode is now called passthrough mode.