alphapapa / prism.el

Disperse Lisp forms (and other languages) into a spectrum of colors by depth
GNU General Public License v3.0
291 stars 4 forks source link

prism-whitespace-mode jit-lock-function unbalanced parentheses errors #34

Open shipmints opened 1 month ago

shipmints commented 1 month ago

Been enjoying the latest version of prism in elisp.

These have come up as I'm back to a Python project where I've enabled prism-whitespace-mode.

Error during redisplay: (jit-lock-function 58044) signaled (scan-error "Unbalanced parentheses" 45206 59284) Error during redisplay: (jit-lock-function 58349) signaled (scan-error "Unbalanced parentheses" 45206 59284)

Also experimenting with @jdtsmith ELPA published indent-bars. There is a negative interaction between prism-whitespace-mode and indent-bars-mode. Continuing to experiment.

alphapapa commented 1 month ago

I guess you mean https://github.com/jdtsmith/indent-bars/issues/61. As I said there, if there is a bug, it shouldn't require indent-bars-mode to manifest.

According to your comment at https://github.com/jdtsmith/indent-bars/issues/61#issuecomment-2359494319 you were using a Tree-Sitter mode and have updated the grammars. So it seems unlikely that this indicates a bug in prism-whitespace-mode.

jdtsmith commented 1 month ago

I'm a little surprised they work together for you, since it looks from a glance like prism-whitespace-mode matches on the same part of the line (blank indents) and prepends a face:

 ((keywords '((prism-match-whitespace 0 prism-face prepend))))

But probably I'm misinterpreting what the mode does. indent-bars simply add face and indent-bars-display properties to specific chars within the leading blank indentation on lines (with a lot of complexity in how it picks those chars, of course).

alphapapa commented 1 month ago

prism-whitespace-mode doesn't apply any faces to whitespace characters, and it only adds to face properties rather than replacing them, so it shouldn't interfere. If it does, it would be a bug, in which case please do report it.