I have lots of open documents in sublime, many of them not saved
I was experimenting with keyboard shortcuts I thought I had created one for sorting tabs, but I hit the wrong one, something along the lines of ctrl-alt-shift-s
And it seems to be doing a close all
So I now have a situation of sublime with a load of unsaved documents and a window that looks like
and if I hit OK then it asks about the next file (so presumably I lose that one). Though that one might not be important, many of them are defunitely untitled and important. Others titled but perhaps not saved.
I can't see a way of getting out of this process without potentially losing all my unsaved files (or updates to saved ones).
What do you suggest?
Further to Hugo's input that it's a JSON, i'd be interested in reading it in a JSON editor / JSON reader.
But I get this error
So maybe it's not a totally valid json? I will try to find out what character is there..
If I try some NodeJS to read the file, I still get an issue
/*
http://stackoverflow.com/questions/14432165/uncaught-syntaxerror-unexpected-token-with-json-parse
// preserve newlines, etc - use valid JSON
s = s.replace(/\\n/g, "\\n")
.replace(/\\'/g, "\\'")
.replace(/\\"/g, '\\"')
.replace(/\\&/g, "\\&")
.replace(/\\r/g, "\\r")
.replace(/\\t/g, "\\t")
.replace(/\\b/g, "\\b")
.replace(/\\f/g, "\\f");
// remove non-printable and other non-valid JSON chars
s = s.replace(/[\u0000-\u0019]+/g,"");
var o = JSON.parse(s);
*/
var fs = require('fs');
fs.readFile('./auto1.json', 'utf8', function (err, data) {
if (err) throw err; // we'll not consider error handling for now
var str=data;
str = str.replace(/\\n/g, "\\n")
.replace(/\\'/g, "\\'")
.replace(/\\"/g, '\\"')
.replace(/\\&/g, "\\&")
.replace(/\\r/g, "\\r")
.replace(/\\t/g, "\\t")
.replace(/\\b/g, "\\b")
.replace(/\\f/g, "\\f")
.replace(/[\u0000-\u001F]+/g,"");
var obj = JSON.parse(data);
});
and I get output
C:\crp\abba>node a.js
undefined:1273
"contents": "\nhtt...
SyntaxError: Unexpected token
at Object.parse (native)
at C:\crp\abba\a.js:36:20
at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
C:\crp\abba>
I'll have to try out smaller parts of the file and try to find the part of the json that is causing the issue. And i'll try sublime on another computer and load the files onto that 'cos sublime is apparently more lenient when reading(and creating!) a json than javascript is.