emacs-tree-sitter / elisp-tree-sitter

Emacs Lisp bindings for tree-sitter
https://emacs-tree-sitter.github.io
MIT License
816 stars 73 forks source link

Don't make `face` property a list if there is only one face #170

Closed ubolonton closed 2 years ago

ubolonton commented 2 years ago

Currently, the text property face is always set to a list, even if there is only one face. This is technically correct, but inefficient, since it creates unnecessary cons cells, which increase GC pressure.

Additionally, it affects packages that incorrectly assumes face to be a singleton (like flyspell; see #168).

With this change, face is not set to a list until there is more than one face.