Skip to content

Commit d6bdd8b

Browse files
committed
Merge branch 'master' into menu-in-access-sheet
2 parents f3a001c + 8ebcf81 commit d6bdd8b

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

packages/app/src/app/components/CodeEditor/CodeMirror/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { getCodeMirror } from 'app/utils/codemirror';
1212
import CodeMirror from 'codemirror';
1313
import { listen } from 'codesandbox-api';
1414
import * as React from 'react';
15+
import { debounce } from 'lodash-es';
1516
import { withTheme } from 'styled-components';
1617
// eslint-disable-next-line
1718
import LinterWorker from 'worker-loader?publicPath=/&name=monaco-linter.[hash:8].worker.js!app/overmind/effects/vscode/LinterWorker/index';
@@ -54,6 +55,7 @@ class CodemirrorEditor extends React.Component<Props, State> implements Editor {
5455
this.settings = props.settings;
5556

5657
this.codeSandboxListener = this.setupCodeSandboxListener();
58+
this.resizeEditor = debounce(this.resizeEditor, 30);
5759
}
5860

5961
setupCodeSandboxListener = () => listen(this.handleMessage);
@@ -79,8 +81,7 @@ class CodemirrorEditor extends React.Component<Props, State> implements Editor {
7981
this.props.width !== nextProps.width ||
8082
this.props.height !== nextProps.height
8183
) {
82-
// eslint-disable-next-line no-unused-expressions
83-
this.codemirror?.refresh();
84+
this.resizeEditor();
8485
return true;
8586
}
8687

@@ -111,6 +112,11 @@ class CodemirrorEditor extends React.Component<Props, State> implements Editor {
111112
});
112113
}
113114

115+
resizeEditor() {
116+
// eslint-disable-next-line no-unused-expressions
117+
this.codemirror?.refresh();
118+
}
119+
114120
setErrors = (errors: Array<ModuleError>) => {
115121
const codeLines = this.codemirror.getValue().split('\n');
116122

packages/homepage/content/docs/2-git.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ description:
88

99
## Base Concept
1010

11-
With CodeSandbox you can import any GitHub repositories as a sandbox (this
11+
With CodeSandbox you can import any GitHub repository as a sandbox (this
1212
concept is described in more detail [here](/docs/importing#import-from-github)).
1313
An imported sandbox will automatically stay in sync with the GitHub repository;
1414
if you make a commit to GitHub it will reflect immediately in the sandbox.
1515

1616
For that reason we've made GitHub sandboxes immutable, this means that you
17-
cannot make direct changes to the sandbox itself. However, you can still fork
18-
the sandbox. When you create a fork of a GitHub sandbox we will still keep a
17+
cannot make direct changes to the sandbox itself. They are treated as [templates](/docs/templates), so you can fork from them. When you create a fork of a GitHub sandbox we will still keep a
1918
reference to the original GitHub repository. This allows you to create commits
2019
and open pull requests from the forked sandboxes.
2120

@@ -25,7 +24,7 @@ Anyone can import public GitHub repositories. You need a [Pro subscription](http
2524

2625
You can see a forked sandbox of a GitHub sandbox as a separate branch. We still
2726
keep a reference to the original branch, and we also track the changes that
28-
happen. When you create a fork of the Git sandbox you will see a new panel in
27+
happen. When you create a fork of the GitHub sandbox you will see a new panel in
2928
the sidebar that looks like this:
3029

3130
![GitHub Sidebar](./images/github-sidebar.png)
16.5 KB
Loading

0 commit comments

Comments
 (0)