I'm using smartparens-strict-mode and trying to get it so that C-w kills a region if selected and the whole line that point is on if not (like this but working with smartparens strict mode).
This is what I have so far:
(defun sp-kill-line-or-region (orig-fun &rest args) "Kill whole line if region not selected." (if (region-active-p) (apply orig-fun args) (kill-whole-line))) (advice-add 'sp-kill-region :around 'sp-kill-line-or-region)
But it doesn't work. If I just do C-w it gives me the error
command-execute: The mark is not set now, so there is no region. However, if I mark something, then C-w, then I can use it like I want (i.e. I can then not mark anything and it will kill the whole line).
I can't figure this one out for whatever reason. Help? Thanks!