|
|
@ -33,6 +33,7 @@ function searchLanguage(l) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function noop() {}
|
|
|
|
function noop() {}
|
|
|
|
|
|
|
|
|
|
|
|
class Carbon extends React.PureComponent {
|
|
|
|
class Carbon extends React.PureComponent {
|
|
|
|
static defaultProps = {
|
|
|
|
static defaultProps = {
|
|
|
|
onChange: noop,
|
|
|
|
onChange: noop,
|
|
|
@ -158,7 +159,8 @@ class Carbon extends React.PureComponent {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
readOnly: this.props.readOnly ? 'nocursor' : false,
|
|
|
|
readOnly: this.props.readOnly ? 'nocursor' : false,
|
|
|
|
// needs to be able to refresh every 16ms to hit 60 frames / second
|
|
|
|
// needs to be able to refresh every 16ms to hit 60 frames / second
|
|
|
|
pollInterval: 16
|
|
|
|
pollInterval: 16,
|
|
|
|
|
|
|
|
showInvisibles: config.hiddenCharacters
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const backgroundImage =
|
|
|
|
const backgroundImage =
|
|
|
|
(this.props.config.backgroundImage && this.props.config.backgroundImageSelection) ||
|
|
|
|
(this.props.config.backgroundImage && this.props.config.backgroundImageSelection) ||
|
|
|
@ -443,9 +445,14 @@ function useSelectedLines(props, editorRef) {
|
|
|
|
}, [])
|
|
|
|
}, [])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function useShowInvisibleLoader() {
|
|
|
|
|
|
|
|
React.useEffect(() => void require('cm-show-invisibles'), [])
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function CarbonContainer(props, ref) {
|
|
|
|
function CarbonContainer(props, ref) {
|
|
|
|
useModeLoader()
|
|
|
|
useModeLoader()
|
|
|
|
useHighlightLoader()
|
|
|
|
useHighlightLoader()
|
|
|
|
|
|
|
|
useShowInvisibleLoader()
|
|
|
|
const editorRef = React.createRef()
|
|
|
|
const editorRef = React.createRef()
|
|
|
|
const onGutterClick = useSelectedLines(props, editorRef)
|
|
|
|
const onGutterClick = useSelectedLines(props, editorRef)
|
|
|
|
|
|
|
|
|
|
|
|