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

Code block maintenance updates #509

merged 9 commits into from Oct 27, 2017


None yet
1 participant

50Wliu commented Oct 26, 2017


  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

  1. Remove unused underscore-plus require
  2. Actually remove the tabindex attribute so that the code block is un-editable. This was done previously but it turned out that getting the model of the editor added it back. So now we remove it after retrieving the model.
  3. Do not render the last trailing newline of a code block.
  4. Fix debouncing of Markdown rendering when receiving grammar update events.

Alternate Designs



Typing isn't allowed in code blocks anymore, and the last newline is removed as expected. If the preview is loaded before grammar packages finish loading, it'll receive proper tokenization once they do.

Possible Drawbacks

Hopefully none.

Applicable Issues

Supersedes and closes #425, which could have potentially left \r in the code block.
Fixes #479
Fixes #491

50Wliu added some commits Oct 26, 2017

50Wliu added some commits Oct 26, 2017

50Wliu added some commits Oct 26, 2017

Update spec for better testing
Don't know why it's failing though

This comment has been minimized.

Show comment
Hide comment

50Wliu Oct 26, 2017


Failing spec seems to be flaky on master as well.


50Wliu commented Oct 26, 2017

Failing spec seems to be flaky on master as well.

Conditionally use (unreleased) atom.grammars.onDidRemoveGrammar
Also allows us to remove onDidUpdateGrammar, since for our use case
add/RemoveGrammar gives us all the info we need

@50Wliu 50Wliu merged commit 9c12023 into master Oct 27, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed

@50Wliu 50Wliu deleted the wl-code-block-updates branch Oct 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment