Skip to content

sp-delete-char and friends do not respect strict mode with delete-selection-mode on #726

@Fuco1

Description

@Fuco1

Expected behavior

If the strict mode is on and delete-selection-mode is enabled, we should not allow to delete regions that would break structure.

Actual behavior

Strict mode checks are ignored and it is possible to delete region leading to breakage.

Steps to reproduce the problem

Enable the two modes, then select text and hit backspace.

Solution

(put 'sp-backward-delete-char 'delete-selection 'supersede)
(put 'sp-delete-char 'delete-selection 'supersede)

should use a callback instead of supersede, and return nil if we can't delete the region, and return supersede when we can.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions