Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upCursor jumps to start of line when typing curly brace in JSX property #81
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
dentafrice
commented
Sep 3, 2018
•
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
felipeochoa
Sep 3, 2018
Owner
Thanks for bisecting. I'm having this issue with the new indentation code, so I'm assuming you have some sort of electric mode (e.g., smartparens) that tries to reindent when you type a curly brace.
|
Thanks for bisecting. I'm having this issue with the new indentation code, so I'm assuming you have some sort of electric mode (e.g., smartparens) that tries to reindent when you type a curly brace. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qhuyduong
commented
Sep 3, 2018
|
I'm facing the same issue. Look forward to seeing the fix soon. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
felipeochoa
Sep 3, 2018
Owner
If you want to see it sooner, it's probably just a fix on rjsx-indent-line. PRs welcome
|
If you want to see it sooner, it's probably just a fix on |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
dentafrice
Sep 3, 2018
so I'm assuming you have some sort of electric mode (e.g., smartparens) that tries to reindent when you type a curly brace.
Unless I'm misunderstanding, I'm reproducing this on a clean emacs installation with just js2-mode and rjsx-mode installed.
I don't think there's any external mode/package interference going on here.
dentafrice
commented
Sep 3, 2018
Unless I'm misunderstanding, I'm reproducing this on a clean emacs installation with just I don't think there's any external mode/package interference going on here. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
danielmt
commented
Sep 3, 2018
•
qhuyduong
referenced this issue
Sep 3, 2018
Closed
Save cursor position before indenting line with attributes #82
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qhuyduong
commented
Sep 3, 2018
|
@felipeochoa I have opened a pull request for this issue. Please check. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jinhale
Sep 6, 2018
Typing a comma will do this as well as long as the comma separates items of an array in an attribute's properties.
jinhale
commented
Sep 6, 2018
|
Typing a comma will do this as well as long as the comma separates items of an array in an attribute's properties. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
gustavo-depaula
commented
Sep 9, 2018
•
|
Suffering with this problem as well! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
qleguennec
commented
Sep 12, 2018
|
Same issue here, using doom-emacs |
felipeochoa
closed this
in
68fe4c0
Sep 13, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
trev-dev
commented
Sep 14, 2018
|
@felipeochoa Thank you for the PR!! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
DoMiNeLa10
Sep 17, 2018
I've been experiencing this problem as well recently, and I'm glad it got resolved before I got to updating rjsx-mode.
DoMiNeLa10
commented
Sep 17, 2018
|
I've been experiencing this problem as well recently, and I'm glad it got resolved before I got to updating |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
deviantfero
Sep 18, 2018
I was having this issue as well, it has been resolved, just stopping by to say thanks for such a wonderful package!
deviantfero
commented
Sep 18, 2018
|
I was having this issue as well, it has been resolved, just stopping by to say thanks for such a wonderful package! |


dentafrice commentedSep 2, 2018
Hi!
Thanks for your work on rjsx-mode.
I'm encountering an issue adding properties to an element. Curly braces seem to trigger a re-indent of the line and cause the cursor to jump to the beginning of the line.
I've recorded a few different examples here.
I'm experiencing this issue in Spacemacs, but I've tried to reproduce this in as bare of an emacs configuration as I can. This is my first time filing an issue with an emacs package, please let me know if there's any additional information that I can provide or if I'm doing something stupid here.
Zero configuration
rjsx-mode
Opening a curly brace de-indents line, closing a curly re-indents (incorrectly to 2 spaces) and places cursor at the beginning of line.
js2-jsx-mode:
Opening a curly brace de-indents the line, closing doesn't fix it. Cursor stays in place.
Fixing indent level
I noticed that by default
js-indent-levelis 4, andsgml-basic-offsetis 2. I added the following code to init.el to make them equal.This seems to fix the indention issues completely in both modes, but
rjsx-mode's cursor still jumps to the beginning of the line.rjsx-mode
js2-jsx-mode
init.el
Versions
GNU Emacs 26.1
rjsx-mode: 20180823.1645
js2-mode: 20180724.801