Skip to content
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

fontify is very slow and sometimes it freeze Emacs #92

Open
shackra opened this issue Nov 4, 2018 · 4 comments
Open

fontify is very slow and sometimes it freeze Emacs #92

shackra opened this issue Nov 4, 2018 · 4 comments

Comments

@shackra
Copy link

shackra commented Nov 4, 2018

I have test this in js-jsx-mode and is even worst.

When writing code, fontify takes a fraction of a second per key press to kick in and sometimes when there is more lines of code Emacs freeze when fontify is happening.

Here is a video https://streamable.com/vkslf

This is what is turned on on my buffer at the time of recording:

Enabled minor modes: Aggressive-Indent Async-Bytecomp-Package
Auto-Composition Auto-Compression Auto-Encryption Auto-Fill
Blink-Cursor Cl-Old-Struct-Compat Column-Number Company
Company-Posframe Company-Statistics Cursor-Sensor Delete-Selection
Diff-Auto-Refine Dired-Omit Display-Line-Numbers Eldoc Electric-Indent
Electric-Pair Emojify File-Name-Shadow Flycheck Flyspell Font-Lock
Git-Gutter Global-Aggressive-Indent Global-Auto-Revert Global-Company
Global-Eldoc Global-Emojify Global-Font-Lock Global-Git-Commit
Global-Git-Gutter Global-Hungry-Delete Global-Magit-File
Global-Subword Global-Undo-Tree Hes Highlight-Numbers Hungry-Delete
Indium-Interaction Ivy Js2-Imenu-Extras Js2-Refactor Keyfreq
Keyfreq-Autosave Line-Number Lsp Lsp--Managed Lsp-Ui Magit-Auto-Revert
Magit-File Mouse-Wheel Override-Global Pcre Prettify-Symbols
Projectile Recentf Save-Place Savehist Shackle Shell-Dirtrack
Show-Paren Subword Telephone-Line Tex-Pdf Transient-Mark Undo-Tree
Winner Ws-Butler Ws-Butler-Global Yas

(Information about these minor modes follows the major mode info.)

JSX-IDE mode defined in ‘js2-mode.el’:
Major mode for editing JSX code.

To customize the indentation for this mode, set the SGML offset
variables (‘sgml-basic-offset’ et al) locally, like so:

  (defun set-jsx-indentation ()
    (setq-local sgml-basic-offset js2-basic-offset))
  (add-hook 'js2-jsx-mode-hook #'set-jsx-indentation)
@felipeochoa
Copy link
Owner

Not sure what I'm supposed to see in that video. Can you explain? Haven't tested, but I'm guessing you'll have problems with Aggressive-Indent. rjsx re-parses the entire buffer every time it needs to indent, so that's always going to cause slowdowns. Can you try setting (setq-local indent-line-function 'js-jsx-indent-line) to see if that fixes things?

@shackra
Copy link
Author

shackra commented Nov 13, 2018

Not sure what I'm supposed to see in that video. Can you explain?

Sure, I meant to point the fraction of second when the text is written into the buffer and is all white and when fontify kicks in. I have had experience sometimes that slows down typing a lot. In the video test above Aggressive Indent was supposed to be off.

I will follow your recommendation and test again.

@jqtruong
Copy link

i'm having the issue with fontify as well. i don't have a video to show, but put simply, when i move my cursor and nearing a lot of jsx code (i.e. the html tags), it gets sluggish. i have had that problem with web mode as well, and it seemed rjsx does a better job.

anyway, wondering if @shackra is having that kind of problem too, or is it the common experience? i evaluated the statement @felipeochoa mentioned, but still sluggish. when i turned rjsx mode off, of course it was flying...

@shackra
Copy link
Author

shackra commented Jan 23, 2019

This is issue is due to this bug on LSP emacs-lsp/lsp-mode#588

Do you use LSP?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants