Fix pw-cli--parse-properties
- Remove some redundancy. - Make sure we don’t search after the end point. - Move to the end point (this is necessary for parsing the following object).
This commit is contained in:
parent
08c9d50a1c
commit
1065d9d389
10
pw-access.el
10
pw-access.el
@ -153,17 +153,17 @@ Note this interface may not work with all PipeWire versions.")
|
||||
|
||||
(defun pw-cli--parse-properties ()
|
||||
(pw-cli--next-line)
|
||||
(let ((end (save-excursion
|
||||
(or (and (re-search-forward "^ Object:" nil t)
|
||||
(point))
|
||||
(point-max))))
|
||||
(let ((end (or (save-excursion (re-search-forward "^ Object:" nil t))
|
||||
(point-max)))
|
||||
(properties '()))
|
||||
(while (re-search-forward "^ Prop: key \\([A-Za-z:]+\\)" end t)
|
||||
(while (and (< (point) end)
|
||||
(re-search-forward "^ Prop: key \\([A-Za-z:]+\\)" end t))
|
||||
(pw-cli--next-line)
|
||||
(let ((property (car (last (split-string (match-string 1) ":"))))
|
||||
(value (pw-cli--read-property)))
|
||||
(when value
|
||||
(push (cons property value) properties))))
|
||||
(goto-char end)
|
||||
properties))
|
||||
|
||||
(cl-defmethod pw-access-properties ((_class pw-cli-accessor) node-id)
|
||||
|
Loading…
Reference in New Issue
Block a user