mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 21:11:30 +08:00 
			
		
		
		
	fix syntax highlight switch
This commit is contained in:
		
							parent
							
								
									27f12a0186
								
							
						
					
					
						commit
						403cf02ea7
					
				| @ -149,14 +149,11 @@ const noteEditor = (function() { | |||||||
|             codeEditor.setValue(currentNote.detail.note_text); |             codeEditor.setValue(currentNote.detail.note_text); | ||||||
| 
 | 
 | ||||||
|             const info = CodeMirror.findModeByMIME(currentNote.detail.mime); |             const info = CodeMirror.findModeByMIME(currentNote.detail.mime); | ||||||
|             let mode = null; | 
 | ||||||
|             if (info) { |             if (info) { | ||||||
|                 mode = info.mode; |                 codeEditor.setOption("mode", info.mime); | ||||||
|  |                 CodeMirror.autoLoadMode(codeEditor, info.mode); | ||||||
|             } |             } | ||||||
| 
 |  | ||||||
|             CodeMirror.autoLoadMode(codeEditor, mode); |  | ||||||
| 
 |  | ||||||
|             codeEditor.setOption("mode", mode); |  | ||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|             throwError("Unrecognized type " + currentNote.detail.type); |             throwError("Unrecognized type " + currentNote.detail.type); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner