nim-lang / nim-mode

An emacs major mode for the Nim programming language
139 stars 46 forks source link

font-lock-mode too slow #198

Closed krux02 closed 6 years ago

krux02 commented 6 years ago

When editing big files, such as gl.nim scrolling blocks for several seconds until syntax highlighting has been resolved for the file. After syntax highlighting for that file has been resolved scrolling works, but editing in that file remains a bad experience so that I need to disable it in that file.

Arch Linux emacs 26.1 no messages in *Messages* buffer. not related to nimsuggest, company, flycheck or el-doc. It is all disabled.

krux02 commented 6 years ago

At this current point, I don't know how emacs does syntax highlighting, but I could profile the matchers, and it seems that most time is wasted in nim-pragma-matcher and nim-type-matcher.

krux02 commented 6 years ago

As a workaround disable font-lock-mode and then call M-x font-lock-fontify-buffer. This doesn't fix anything, but at least it makes editing a bigger nim file possible without missing out in Nim syntax highlighting entirely.

yuutayamada commented 6 years ago

@krux02 is this issue fixed by your PR?

krux02 commented 6 years ago

yes it is. Sorry I forgot to close this.