felipeochoa / rjsx-mode

A JSX major mode for Emacs
https://github.com/felipeochoa/rjsx-mode
MIT License
641 stars 32 forks source link

Typing an = sign crashes/hangs emacs #100

Closed phuhl closed 5 years ago

phuhl commented 5 years ago

Ok, I am not entirely sure how to reproduce it, but I think, if you are in an JSX-block and you type a parameter, then the =-sign and that is before the closing tag, than it indefenitly hangs and is not recoverable with C-g or anything I know of. I once let it run for more than 10 minutes but it just eats CPU and does nothing.

I think it only happens on Windows, not on my linux setup that is otherwise nearly the same.

Example:

 <View style=></View>
             \_ there is the cursor (behind =) and after typing the = it hangs. It will get displayed, though

js2-jsx-mode does not appear to have this issue.

My full configuration can be fund here: https://github.com/phuhl/sheeshmacs It is emacs GNU Emacs 26.1 (build 1, i686-w64-mingw32) of 2018-05-30 on Windows 10 x64 and rjsx-mode version 20190312.117.

The most relevant part of my documentation is this I think:

(use-package rjsx-mode
  :ensure t
  :mode ("\\.js$" . rjsx-mode)
  :interpreter ("node" . rjsx-mode)
  :init

  ;; Set indentation to 2 spaces
  (setq rjsx-basic-offset 2)
  (custom-set-variables
   '(js-indent-level 2))

  :config
  (add-hook 'rjsx-mode-hook 'run-starter-kit-coding-hook)
  (add-hook 'rjsx-mode-hook
            '(lambda ()
               (define-key rjsx-mode-map (kbd "C-c i") 'js-doc-insert-function-doc)
               (define-key rjsx-mode-map "@" 'js-doc-insert-tag)))
  )
felipeochoa commented 5 years ago

I don't have Windows easily available to attempt to reproduce, but am not seeing it on Linux. Seems like a strange thing to be OS dependent though.

Can you try running in an emacs -Q session and reproducing?

phuhl commented 5 years ago

A lot of testing later it turns out that deleting the elpa folder and reinstalling the plugins fixes the issue... Apparently the elisp-compiled files differ somehow. Sorry to have you bothered with this, I did'nt expect the fix to be that simple