File tree Expand file tree Collapse file tree 4 files changed +18
-1
lines changed Expand file tree Collapse file tree 4 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -251,7 +251,7 @@ export default class CodeEditor extends React.Component {
251
251
value : this . props . value ,
252
252
linesHighlighted : this . props . linesHighlighted ,
253
253
lineNumbers : this . props . displayLineNumbers ,
254
- lineWrapping : true ,
254
+ lineWrapping : this . props . lineWrapping ,
255
255
theme : this . props . theme ,
256
256
indentUnit : this . props . indentSize ,
257
257
tabSize : this . props . indentSize ,
@@ -550,6 +550,10 @@ export default class CodeEditor extends React.Component {
550
550
this . editor . setOption ( 'lineNumbers' , this . props . displayLineNumbers )
551
551
}
552
552
553
+ if ( prevProps . lineWrapping !== this . props . lineWrapping ) {
554
+ this . editor . setOption ( 'lineWrapping' , this . props . lineWrapping )
555
+ }
556
+
553
557
if ( prevProps . scrollPastEnd !== this . props . scrollPastEnd ) {
554
558
this . editor . setOption ( 'scrollPastEnd' , this . props . scrollPastEnd )
555
559
}
Original file line number Diff line number Diff line change @@ -720,6 +720,7 @@ class SnippetNoteDetail extends React.Component {
720
720
mode = { snippet . mode || ( autoDetect ? null : config . editor . snippetDefaultLanguage ) }
721
721
value = { snippet . content }
722
722
linesHighlighted = { snippet . linesHighlighted }
723
+ lineWrapping = { config . editor . lineWrapping }
723
724
theme = { config . editor . theme }
724
725
fontFamily = { config . editor . fontFamily }
725
726
fontSize = { editorFontSize }
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ export const DEFAULT_CONFIG = {
50
50
fontFamily : win ? 'Consolas' : 'Monaco' ,
51
51
indentType : 'space' ,
52
52
indentSize : '2' ,
53
+ lineWrapping : true ,
53
54
enableRulers : false ,
54
55
rulers : [ 80 , 120 ] ,
55
56
displayLineNumbers : true ,
Original file line number Diff line number Diff line change @@ -546,6 +546,17 @@ class UiTab extends React.Component {
546
546
</ label >
547
547
</ div >
548
548
549
+ < div styleName = 'group-checkBoxSection' >
550
+ < label >
551
+ < input onChange = { ( e ) => this . handleUIChange ( e ) }
552
+ checked = { this . state . config . editor . lineWrapping }
553
+ ref = 'editorLineWrapping'
554
+ type = 'checkbox'
555
+ />
556
+ { i18n . __ ( 'Wrap line in Snippet Note' ) }
557
+ </ label >
558
+ </ div >
559
+
549
560
< div styleName = 'group-checkBoxSection' >
550
561
< label >
551
562
< input onChange = { ( e ) => this . handleUIChange ( e ) }
You can’t perform that action at this time.
0 commit comments