wavedrom / wavedrom.github.io

Digital timing diagram editor
https://wavedrom.com
MIT License
921 stars 160 forks source link

editor crashes #49

Closed parafux closed 4 years ago

parafux commented 4 years ago

I try to edit the following code with the online editor or the downloaded software editor.

if i change i++ to i+1 or i+ or anything else, that was a mistypo. then the editor crashes. a reload does not help, because the cache is still full with the errornous code.

The downloaded software cannot be started again, because the errornous code is still in the cache, so propably i have to delete any init file or reinstall the software.

Seems to be an issue with an endless loop, that temporary exists in my code, but that i did not really want to be translated.

But even if i coded a bug, the tool should not hang up.

(function (bits, ticks) { var i, t, gray, state, data = [], arr = []; for (i = 0; i < bits; i++) { arr.push({name: i + '', wave: ''}); state = 1; for (t = 0; t < ticks; t++) { data.push(t + ''); gray = (((t >> 1) ^ t) >> i) & 1; arr[i].wave += (gray === state) ? '.' : gray + ''; state = gray; } } arr.unshift('gray'); return {signal: [ {name: 'bin', wave: '='.repeat(ticks), data: data}, arr ]}; })(5, 16)

parafux commented 4 years ago

obviously the portable version uses the same cache as the installed version. so even the installed version, i cannot start, it also hangs in this endless loop. Even when i completely delete the portable version, i cannot start the installed version.

drom commented 4 years ago

I have fixed WebApp to store source code only after execution to avoid infinite loops.

To clear browser cache: click here

To clear Desktop App cache look here: http://docs.nwjs.io/en/latest/References/Command%20Line%20Options/#-user-data-dir

parafux commented 4 years ago

perfect, that helps for using the web-interface. also the cache for the desktop app could be cleared now: C:\Users\\AppData\Local\WaveDromEditor\User Data

parafux commented 4 years ago

Could you please do the changes, you have done on the WebApp also for the DesktopApp and the PortableApp?

drom commented 4 years ago

v2.1.6 release includes this fix. https://github.com/wavedrom/wavedrom.github.io/releases/tag/v2.1.8