Skip to content
This repository has been archived by the owner on Oct 11, 2022. It is now read-only.

Create new code block on space #55

Merged
merged 2 commits into from
Apr 15, 2018
Merged

Create new code block on space #55

merged 2 commits into from
Apr 15, 2018

Conversation

mxstbr
Copy link

@mxstbr mxstbr commented Apr 13, 2018

This means we don't require enter to create new code blocks, which solves a couple QoL issues. Ref withspectrum/spectrum#2854

/cc @brianlovin

@mxstbr mxstbr requested a review from juliankrispel April 13, 2018 14:46
Copy link

@juliankrispel juliankrispel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<3

const text = currentBlock.getText();
const type = currentBlock.getType();
if (type !== "code-block" && CODE_BLOCK_REGEX.test(text))
newEditorState = handleNewCodeBlock(editorState);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test case?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's a feature it makes sense to add it to the test harness imo

@mxstbr
Copy link
Author

mxstbr commented Apr 13, 2018

Good call, thanks for keeping me in check! Does that test case look good to you?

@mxstbr mxstbr merged commit 938fdb8 into master Apr 15, 2018
@mxstbr mxstbr deleted the new-code-block-on-space branch April 15, 2018 09:14
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