-
Notifications
You must be signed in to change notification settings - Fork 347
font-lock mode hangs with unbalanced left-parenthesis in type signature near top of long file #1344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Using profile-report in Emacs, it appears to blame haskell-syntax-propertize, but I have no practice at profiling elisp. |
Culprit is here: haskell-mode/haskell-font-lock.el Line 261 in fa57f91
I guess we cannot rely on balanced parentheses in type declarations. |
Good to know where the 20 second delay comes from. Quickly failing to balance and not updating highlighting should be okay. Too bad there is no background thread for this sort of thing. |
I've found a better solution. |
@ChrisKuklewicz, fixed. It should be on melpa even today. |
Awesomely fast response, thanks! |
I am running Emacs (GNU Emacs 24.5.1 (i686-pc-mingw32)) on Windows, and haskell-mode 1.5
When I am in a big haskell file (1000 lines) and at the bottom of the file I can type a new line:
foo :: (some text goes here
This works well and performance appears fine.
But if I type that at the top of the file (just under the import statements for instances) then once I hit the left-parenthesis (which is unbalanced) the rate of response from Emacs drops to less than one character per second, often I have to wait for 10 to 20 seconds for any of "some text goes here" to appear in the buffer after the left parenthesis.
Note that this performance bug only occurs when the unbalanced left parenthesis is part of a type, not when it is part of a normal expression.
This is such a serious performance bug it essentially hangs Emacs. I have to disable font-lock mode when editing many haskell files.
The text was updated successfully, but these errors were encountered: