0

I defined a polymode with julia-mode as the inner mode. It works well but sometimes syntax highlighting goes wrong and it can be fixed only by restarting emacs. I haven't figured out how I can reproduce it though. When it happens, the inner mode parts are all rendered in the same color, and the color changes by whether the point is in the inner mode or not. I guess something is wrong in my polymode definition but have no idea. What could be the cause of this and how can I debug this sort of situation?

(require 'julia-mode)
(require 'poly-markdown)

(define-innermode poly-julia-markdown-inline-code-innermode poly-markdown-inline-code-innermode
  :mode 'julia-mode
  :head-matcher (cons "^[ \t]*\\(```{?[Jj]ulia.*\n\\)" 1)
  :tail-matcher (cons "^[ \t]*\\(```\\)[ \t]*$" 1)
  :head-mode 'host
  :tail-mode 'host)

(define-polymode poly-markdown+julia-mode poly-markdown-mode :lighter " PM-jmd"
  :innermodes '(poly-julia-markdown-inline-code-innermode))

Nomally working

enter image description here

When broken

enter image description here

shg
  • 1
  • Why don't you open an issue for polymode directly? Then the maintainer could answer your problem: https://github.com/polymode/polymode – Tom Mar 17 '20 at 20:13
  • I haven't done so because I was not sure whether this is an issue of polymode or my config. So I am asking how I can figure it out. – shg Mar 18 '20 at 07:44

0 Answers0