mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-30 04:01:31 +08:00 
			
		
		
		
	enable line wrap for code editor
This commit is contained in:
		
							parent
							
								
									585398ad5c
								
							
						
					
					
						commit
						137ffcc4e3
					
				| @ -32,7 +32,10 @@ async function show() { | |||||||
|             lint: true, |             lint: true, | ||||||
|             gutters: ["CodeMirror-lint-markers"], |             gutters: ["CodeMirror-lint-markers"], | ||||||
|             lineNumbers: true, |             lineNumbers: true, | ||||||
|             tabindex: 100 |             tabindex: 100, | ||||||
|  |             // we linewrap partly also because without it horizontal scrollbar displays only when you scroll
 | ||||||
|  |             // all the way to the bottom of the note. With line wrap there's no horizontal scrollbar so no problem
 | ||||||
|  |             lineWrapping: true | ||||||
|         }); |         }); | ||||||
| 
 | 
 | ||||||
|         onNoteChange(noteDetailService.noteChanged); |         onNoteChange(noteDetailService.noteChanged); | ||||||
| @ -43,7 +46,9 @@ async function show() { | |||||||
|     const currentNote = noteDetailService.getCurrentNote(); |     const currentNote = noteDetailService.getCurrentNote(); | ||||||
| 
 | 
 | ||||||
|     // this needs to happen after the element is shown, otherwise the editor won't be refreshed
 |     // this needs to happen after the element is shown, otherwise the editor won't be refreshed
 | ||||||
|     codeEditor.setValue(currentNote.content); |     // CodeMirror breaks pretty badly on null so even though it shouldn't happen (guarded by consistency check)
 | ||||||
|  |     // we provide fallback
 | ||||||
|  |     codeEditor.setValue(currentNote.content || ""); | ||||||
| 
 | 
 | ||||||
|     const info = CodeMirror.findModeByMIME(currentNote.mime); |     const info = CodeMirror.findModeByMIME(currentNote.mime); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner