Skip to content

Commit de6aadd

Browse files
MaxWeisenJIB3377mhmaidi789dieunity
committed
Fixed Monaco editor issue where cursor was exponentially offset from actual location, only on Windows. This was resolved by specifying a fontFamily and fontSize in the Monaco editor options.
Co-authored-by: Justin Baik <bij3377@gmail.com> Co-authored-by: Max Weisenberger <germanbluemax@gmail.com> Co-authored-by: Mo Hmaidi <mhmaidi789@gmail.com> Co-authored-by: Dieu Huynh <dieuhhuynh@gmail.com>
1 parent ce703a5 commit de6aadd

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/components/EditorView/EditorView.jsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@ const Editor = () => {
2121
colorDecorators: true,
2222
wrappingIndent: 'indent',
2323
automaticLayout: true,
24+
codeLens: true,
25+
// Added specific fontfamily and fontsize to address Windows curson misalignment issue
26+
fontFamily: 'courier new',
27+
fontSize: 12,
2428
};
2529

2630
const editorDidMount = () => {
2731
editor.setTheme('light-dark');
28-
// editor.focus();
2932
};
3033

3134
const updatafile = (newValue, e) => {

src/components/Modals/Modal.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,13 @@ const Modal = ({
199199
and includes the following code:
200200
<br />
201201
</div>
202-
<pre>
203-
<div className="code-wrapper">
204-
<code>
205-
{`module.exports = {presets: ['@babel/preset-env', '@babel/preset-react']}`};
206-
</code>
207-
</div>
208-
</pre>
202+
<pre>
203+
<div className="code-wrapper">
204+
<code>
205+
{`module.exports = {presets: ['@babel/preset-env', '@babel/preset-react']}`}
206+
</code>
207+
</div>
208+
</pre>
209209
</AccordionDetails>
210210
</Accordion>
211211
)

0 commit comments

Comments
 (0)