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

Guard insert colon with when clause. #297

Merged

Conversation

phyllisstein
Copy link
Member

@phyllisstein phyllisstein commented May 26, 2021

This change tweaks the way insertColonOrSemicolon avoids clobbering editor.acceptSuggestionOnEnter. Executing cursorDown led to some wonky behavior for me. It felt counterintuitive that Enter didn't insert a newline---particularly with autoclosing enabled, as this input...

export const Comp = styled.div`|`

...followed by Enter, produced this:

export const Comp = styled.div``
|

With this change, the command will simply not bind to Enter when acceptSuggestionOnEnter is disabled.

@jasonwilliams
Copy link
Collaborator

jasonwilliams commented May 26, 2021

@phyllisstein that looks like a great fix, thanks! I’ll test it this week

@jasonwilliams
Copy link
Collaborator

Tested, seems to work ok for me

@jasonwilliams jasonwilliams merged commit 071d7b4 into styled-components:master May 26, 2021
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

Successfully merging this pull request may close these issues.

None yet

2 participants