<commit_before>import BaseEditor, { DiffEditor as BaseDiffEditor} from '@monaco-editor/react';
import React, { useRef, useState } from "react";

import Loader from '../components/Loader'

import styles from './Editor.css'

LANGUAGE_TO_MONACO_STYLE =
    "Python": "python",
    "Pascal": "pascal",
    "C++": "cpp",
    " C": "cpp",  # space important
    "Delphi": "pascal",
    "Java": "java"
    "PHP": "php",
    "Perl": "perl",
    "C#": "csharp",
    "Ruby": "ruby",
    
getLanguage = (lang) ->
    for l, style of LANGUAGE_TO_MONACO_STYLE
        if lang && lang.includes(l)
            return style
    return undefined

export DiffEditor = (props) ->
    options = 
        autoClosingBrackets: "never"
        autoClosingOvertype: "never" 
        autoClosingQuotes: "never"
        scrollBeyondLastLine: false
        minimap: {enabled: false}
    editorDidMount = (orig, modif, e) ->
        props.editorDidMount?(orig, modif, e)
        fun = () ->
            e.layout()
        setTimeout(fun, 100)
    height = "600px"
    if props.height != undefined
        height = props.height
    if not height
        height = undefined
    <BaseDiffEditor height={height} original={props.original} modified={props.modified} language={getLanguage(props.language)} loading={<Loader />} options={options} className={styles.editor} editorDidMount={editorDidMount}/>

export default Editor = (props) ->
    options = 
        autoClosingBrackets: "never"
        autoClosingOvertype: "never" 
        autoClosingQuotes: "never"
        scrollBeyondLastLine: false
        minimap: {enabled: false}
    <BaseEditor height="600px" language={getLanguage(props.language)} value={props.value} loading={<Loader />} options={options} className={styles.editor} editorDidMount={props.editorDidMount}/>
<commit_msg>Set enpty editor value instead of undefined (fix #202)<commit_after>import BaseEditor, { DiffEditor as BaseDiffEditor} from '@monaco-editor/react';
import React, { useRef, useState } from "react";

import Loader from '../components/Loader'

import styles from './Editor.css'

LANGUAGE_TO_MONACO_STYLE =
    "Python": "python",
    "Pascal": "pascal",
    "C++": "cpp",
    " C": "cpp",  # space important
    "Delphi": "pascal",
    "Java": "java"
    "PHP": "php",
    "Perl": "perl",
    "C#": "csharp",
    "Ruby": "ruby",
    "Go": "go"
    
getLanguage = (lang) ->
    for l, style of LANGUAGE_TO_MONACO_STYLE
        if lang && lang.includes(l)
            return style
    return undefined

export DiffEditor = (props) ->
    options = 
        autoClosingBrackets: "never"
        autoClosingOvertype: "never" 
        autoClosingQuotes: "never"
        scrollBeyondLastLine: false
        minimap: {enabled: false}
    editorDidMount = (orig, modif, e) ->
        props.editorDidMount?(orig, modif, e)
        fun = () ->
            e.layout()
        setTimeout(fun, 100)
    height = "600px"
    if props.height != undefined
        height = props.height
    if not height
        height = undefined
    <BaseDiffEditor height={height} original={props.original} modified={props.modified} language={getLanguage(props.language)} loading={<Loader />} options={options} className={styles.editor} editorDidMount={editorDidMount}/>

export default Editor = (props) ->
    options = 
        autoClosingBrackets: "never"
        autoClosingOvertype: "never" 
        autoClosingQuotes: "never"
        scrollBeyondLastLine: false
        minimap: {enabled: false}
    <BaseEditor height="600px" language={getLanguage(props.language)} value={props.value || ""} loading={<Loader />} options={options} className={styles.editor} editorDidMount={props.editorDidMount}/>

{'fraction_non_alphanumeric': 0.1375747688961392, 'fraction_numerical': 0.005709624796084829, 'mean_word_length': 3.1664779161947907, 'pattern_counts': {'":': 21, '<': 11, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6589369', 'n_tokens_mistral': 1161, 'n_tokens_neox': 1116, 'n_words': 268}