Skip to content

Commit

Permalink
Inspect string text properties
Browse files Browse the repository at this point in the history
See issue #19
  • Loading branch information
mmontone committed Mar 9, 2023
1 parent 0c621de commit 7b70a20
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions inspector.el
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
;; Author: Mariano Montone <[email protected]>
;; URL: https://github.com/mmontone/emacs-inspector
;; Keywords: debugging, tool, lisp, development
;; Version: 0.20
;; Version: 0.21
;; Package-Requires: ((emacs "27.1"))

;; This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -563,7 +563,12 @@ is expected to be used.")
(cl-defmethod inspector-inspect-object ((string string))
"Render inspector buffer for STRING."
(inspector--insert-title "string")
(prin1 string (current-buffer)))
(prin1 string (current-buffer))
(let ((text-properties (text-properties-at 0 string)))
(when text-properties
(newline 2)
(inspector--insert-label "Text properties")
(inspector--insert-inspect-button text-properties))))

(cl-defmethod inspector-inspect-object ((array array))
"Render inspector buffer for ARRAY."
Expand Down

2 comments on commit 7b70a20

@yantar92
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will not work for text properties not at the beginning of string.

@yantar92
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See object-intervals

Please sign in to comment.