meow-edit / meow

Yet another modal editing on Emacs / 猫态编辑
GNU General Public License v3.0
1.07k stars 128 forks source link

`Backspace` key delete region not work, Bug or Design? #574

Closed sawyerzheng closed 2 months ago

sawyerzheng commented 2 months ago

when I enable meow-global-mode , backspace key will cannot delete selected region any more. Is it a bug, or just a design on purpose.

When I disable meow-global-mode , backspace will can delete region again.

DogLooksGood commented 2 months ago

It's designed by purpose. Since we have navigation commands creating selections, it's common to some a region when we are moving the cursor. In order to not to always cancel the selection before kill/delete, we split the deletion/kill commands into two categories: respecting the selection and ignoring the selection.

To kill the region, you always use kill, just like you have to use C-w in vanilla Emacs. To delete the character, you use meow-delete(or C-d) and backspace.

The fact that you can delete region with backspace is because you have delete-active-region set to t.

sawyerzheng commented 2 months ago

Get it, thanks.

tamwile commented 2 hours ago

Would it be possible to reactivate delete-active-region when we are in insert mode ?

I tried something like that: (meow-disable-mode-hook . (lambda () (setq delete-active-region t))) (meow-insert-mode-hook . (lambda () (setq delete-active-region t))) (meow-insert-exit-hook . (lambda () (setq delete-active-region nil))) (meow-normal-mode-hook . (lambda () (setq delete-active-region nil)))

But it's only partially working. When i move the cursor inside an sexp, moving past the opening round bracket, the value of delete-active-region goes back to nil, even though i am in insert mode.