|
|
|
@ -218,8 +218,11 @@ class Editor { |
|
|
|
|
* @param {string} path Path of the file |
|
|
|
|
*/ |
|
|
|
|
_getMode (path) { |
|
|
|
|
let ext = path.indexOf('.') !== -1 ? /[^.]+$/.exec(path) : null |
|
|
|
|
if (ext) ext = ext[0] |
|
|
|
|
let ext = path.indexOf('.') !== -1 ? /[^.]+/.exec(path) : null |
|
|
|
|
if (ext) ext = path.replace(ext[0] + '.', '') // we get <ext>
|
|
|
|
|
ext = ext.split('#') |
|
|
|
|
if (!ext.length) return this.modes['txt'] |
|
|
|
|
ext = ext[0] |
|
|
|
|
return ext && this.modes[ext] ? this.modes[ext] : this.modes['txt'] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|