Skip to content
This repository has been archived by the owner on Jun 30, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants