mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-13 21:13:04 +00:00
; Debug code fixes
* yasnippet-debug.el (yas-debug-live-range): Consider an overlay as live, not dead even though it has integer bounds. (yas-debug-with-tracebuf): Add debug declaration.
This commit is contained in:
parent
8328c38d77
commit
ffc733d4cf
@ -141,7 +141,9 @@
|
|||||||
(decorator-end (overlay-get ov 'after-string))
|
(decorator-end (overlay-get ov 'after-string))
|
||||||
(beg (yas-debug-ov-fom-start range))
|
(beg (yas-debug-ov-fom-start range))
|
||||||
(end (yas-debug-ov-fom-end range)))
|
(end (yas-debug-ov-fom-end range)))
|
||||||
(if (and beg end (not (integerp beg)) (not (integerp end)))
|
(if (and beg end (or (overlayp range)
|
||||||
|
(and (not (integerp beg))
|
||||||
|
(not (integerp end)))))
|
||||||
(propertize (format "from %d to %d" (+ beg) (+ end))
|
(propertize (format "from %d to %d" (+ beg) (+ end))
|
||||||
'cursor-sensor-functions
|
'cursor-sensor-functions
|
||||||
`(,(lambda (_window _oldpos dir)
|
`(,(lambda (_window _oldpos dir)
|
||||||
@ -155,7 +157,7 @@
|
|||||||
"<dead>")))
|
"<dead>")))
|
||||||
|
|
||||||
(defmacro yas-debug-with-tracebuf (outbuf &rest body)
|
(defmacro yas-debug-with-tracebuf (outbuf &rest body)
|
||||||
(declare (indent 1))
|
(declare (indent 1) (debug (sexp body)))
|
||||||
(let ((tracebuf-var (make-symbol "tracebuf")))
|
(let ((tracebuf-var (make-symbol "tracebuf")))
|
||||||
`(let ((,tracebuf-var (or ,outbuf (get-buffer-create "*YASnippet trace*"))))
|
`(let ((,tracebuf-var (or ,outbuf (get-buffer-create "*YASnippet trace*"))))
|
||||||
(unless (eq ,tracebuf-var (current-buffer))
|
(unless (eq ,tracebuf-var (current-buffer))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user