Open dieggsy opened 6 years ago
We should probably introduce evil-smartparens-local-mode-map
to solve this.
@expez could you elaborate on what you mean by that a bit? Are you saying evil-smartparens-mode-map
basically does have to be local cause of this, and it should be called evil-smartparens-local-mode-map
?
evil has to maps for everything e.g. an evil-insert-state-map
and an evil-insert-state-local-map
where the local map is used for overriding, on a per-buffer basis, the global key map.
I haven't done any digging yet, but I think this could probably be solved by having two maps, like evil has.
https://github.com/expez/evil-smartparens/commit/026d4a3cfce415a4dfae1457f871b385386e61d3 needs to be more carefully thought out - it only partially fixed the issue. More specifically, as soon as evil-smartparens is loaded at all (in any buffer), the
DEL
key is rebound for every buffer that hasevil-smartparens-mode
on (since the binding uses the global variableevil-smartparens-mode-map
), regardless of whethersmartparens-strict-mode
is on in that buffer.I've found a temporary work around thorugh
(make-variable-buffer-local 'evil-smartparens-mode-map)
, but that's kind of hackish and doesn't feel like a final solution. One option could be to go thegeneral-predicate-dispatch
way and bind DEL to something like (macro-expansion ofgeneral-predicate-dispatch
, could probably just use anif
statement for our purposes):Which essentially actively checks if smartparens-strict-mode is enabled and does nothing if not.