(code)
| 253 | } |
| 254 | } |
| 255 | onFileChanged(code) { |
| 256 | var path = this.data.path; |
| 257 | code.stop(); |
| 258 | if (path.endsWith(".js") || path.endsWith(".ts") || path.endsWith(".mjs")) |
| 259 | code.type = "js"; |
| 260 | else if (path.endsWith(".json")) |
| 261 | code.type = "json"; |
| 262 | else if (path.endsWith(".xml")) |
| 263 | code.type = "xml"; |
| 264 | else |
| 265 | code.type = "text"; |
| 266 | let string = system.readFileString(path); |
| 267 | // if (string.length > 0x7FFF) |
| 268 | // string = string.slice(0, 0x7FFF); |
| 269 | code.string = string; |
| 270 | this.insertionOffset = -1; |
| 271 | this.history = []; |
| 272 | this.historyIndex = 0; |
| 273 | var lines = this.data.LINES; |
| 274 | lines.behavior.onEdited(lines, code); |
| 275 | code.container.scrollTo(0, 0); |
| 276 | } |
| 277 | onReveal(code) { |
| 278 | code.container.reveal(code.selectionBounds, true); |
| 279 | } |
no test coverage detected