Robin S Posted Tuesday at 04:42 AM Share Posted Tuesday at 04:42 AM @adrian, yes, that's the code prefix I'm using. In the checkIfUnsavedChanges() JS function I logged the two pieces of code that are compared to see if there are unsaved changes: if(snippet && tab) { var snippet_code = snippet.code.replace(/\s+/g, ' ').trim(); var tab_code = tab.code.replace(/\s+/g, ' ').trim(); console.log("snippet_code: " + snippet_code); console.log("tab_code: " + tab_code); } So the snippet code that's loaded from tracyConsoleSnippets in local storage seems to have the prefix included. 1 Link to comment Share on other sites More sharing options...
Robin S Posted Tuesday at 05:02 AM Share Posted Tuesday at 05:02 AM @adrian, the issue is resolved if I change line 111 of ConsolePanel.php to: $snippets[$i]['code'] = str_replace(\TracyDebugger::getDataValue('consoleCodePrefix'), '', file_get_contents($snippetFileName)); 1 Link to comment Share on other sites More sharing options...
adrian Posted Tuesday at 01:11 PM Author Share Posted Tuesday at 01:11 PM Thanks @Robin S - when I was testing last night with adding a code prefix, I was forgetting to reload the page with the console panel open. I was just re-saving a snippet and checking that the prefix was added to the saved file, but until the page is reloaded, the loaded snippet code wasn't including the prefix. Thanks for your help testing and fixing. It's now available in the latest version. FYI - next step is to move all the cached stuff from localStorage to IndexedDB so there is the room (and performance) to store the results pane for each entry in the history stack. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now