Live reload on file tree changes and project settings changes (#4142)
* Reload FileTree and File when changed externally * Added tests * Make file and project creation a bit more reliable
This commit is contained in:
		
							
								
								
									
										3
									
								
								src/lib/codeEditor.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								src/lib/codeEditor.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,3 @@
 | 
			
		||||
export const normalizeLineEndings = (str: string, normalized = '\n') => {
 | 
			
		||||
  return str.replace(/\r?\n/g, normalized)
 | 
			
		||||
}
 | 
			
		||||
@ -14,6 +14,7 @@ import { codeManager } from 'lib/singletons'
 | 
			
		||||
import { fileSystemManager } from 'lang/std/fileSystemManager'
 | 
			
		||||
import { getProjectInfo } from './desktop'
 | 
			
		||||
import { createSettings } from './settings/initialSettings'
 | 
			
		||||
import { normalizeLineEndings } from 'lib/codeEditor'
 | 
			
		||||
 | 
			
		||||
// The root loader simply resolves the settings and any errors that
 | 
			
		||||
// occurred during the settings load
 | 
			
		||||
@ -182,7 +183,3 @@ export const homeLoader: LoaderFunction = async (): Promise<
 | 
			
		||||
  }
 | 
			
		||||
  return {}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const normalizeLineEndings = (str: string, normalized = '\n') => {
 | 
			
		||||
  return str.replace(/\r?\n/g, normalized)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user