Fix wrong-type-argument errors on backspace
Caused when pressed at the beginning or end of a buffer.
This commit is contained in:
parent
74d364776e
commit
3f2318bc69
1 changed files with 4 additions and 3 deletions
|
@ -127,10 +127,11 @@ possible, or just one char if that's not possible."
|
||||||
open-len close-len)
|
open-len close-len)
|
||||||
(cond ;; When in strings (sp acts weird with quotes; this is the fix)
|
(cond ;; When in strings (sp acts weird with quotes; this is the fix)
|
||||||
;; Also, skip closing delimiters
|
;; Also, skip closing delimiters
|
||||||
((and (string= op cl)
|
((and op cl
|
||||||
(and (string= (char-to-string (char-before)) op)
|
(string= op cl)
|
||||||
|
(and (string= (char-to-string (or (char-before) 0)) op)
|
||||||
(setq open-len (length op)))
|
(setq open-len (length op)))
|
||||||
(and (string= (char-to-string (char-after)) cl)
|
(and (string= (char-to-string (or (char-after) 0)) cl)
|
||||||
(setq close-len (length cl))))
|
(setq close-len (length cl))))
|
||||||
(delete-char (- open-len))
|
(delete-char (- open-len))
|
||||||
(delete-char close-len))
|
(delete-char close-len))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue