This repository was archived by the owner on Dec 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +17
-2
lines changed
Expand file tree Collapse file tree 3 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,12 @@ export default class AtomTextEditor extends React.Component {
8080
8181 componentDidMount ( ) {
8282 const modelProps = extractProps ( this . props , editorCreationProps ) ;
83+ if ( ! modelProps . grammar && modelProps . buffer ) {
84+ modelProps . grammar = atom . grammars . selectGrammarWithScore (
85+ modelProps . buffer . getPath ( ) ,
86+ modelProps . buffer . getText ( ) ) ;
87+ }
88+
8389
8490 this . refParent . map ( element => {
8591 const editor = new TextEditor ( modelProps ) ;
Original file line number Diff line number Diff line change @@ -193,6 +193,10 @@ export default class CommitView extends React.Component {
193193 buffer = { this . props . messageBuffer }
194194 workspace = { this . props . workspace }
195195 didChangeCursorPosition = { this . didMoveCursor }
196+ grammar = { atom . grammars . selectGrammarWithScore (
197+ this . props . messageBuffer . getPath ( ) ,
198+ this . props . messageBuffer . getText ( ) ,
199+ ) }
196200 />
197201 < button
198202 ref = { this . refCoAuthorToggle . setter }
Original file line number Diff line number Diff line change @@ -61,14 +61,19 @@ export default class PatchPreviewView extends React.Component {
6161 }
6262
6363 render ( ) {
64+ const buffer = this . state . previewPatchBuffer . getBuffer ( ) ;
6465 return (
6566 < AtomTextEditor
66- buffer = { this . state . previewPatchBuffer . getBuffer ( ) }
67+ buffer = { buffer }
6768 readOnly = { true }
6869 lineNumberGutterVisible = { false }
6970 autoHeight = { true }
7071 autoWidth = { false }
71- softWrapped = { false } >
72+ softWrapped = { false }
73+ grammar = { atom . grammars . selectGrammarWithScore (
74+ buffer . getPath ( ) ,
75+ buffer . getText ( ) ,
76+ ) } >
7277
7378 { this . props . config . get ( 'github.showDiffIconGutter' ) && (
7479 < Gutter name = "diff-icons" priority = { 1 } type = "line-number" className = "icons" labelFn = { blankLabel } />
You can’t perform that action at this time.
0 commit comments