| 97 | const name = fileInfo.name || file.filename || uri; |
| 98 | const readOnly = fileInfo.canWrite ? false : true; |
| 99 | const createEditor = (isUnsaved, text, detectedEncoding) => { |
| 100 | new EditorFile(name, { |
| 101 | uri, |
| 102 | text, |
| 103 | cursorPos, |
| 104 | isUnsaved, |
| 105 | render, |
| 106 | onsave, |
| 107 | readOnly, |
| 108 | encoding: detectedEncoding || encoding, |
| 109 | SAFMode: mode, |
| 110 | savedMtime: helpers.getStatMtime(fileInfo), |
| 111 | diskMtime: helpers.getStatMtime(fileInfo), |
| 112 | }); |
| 113 | }; |
| 114 | |
| 115 | // Check for registered file handlers |
| 116 | const customHandler = fileTypeHandler.getFileHandler(name); |