adobe / brackets

An open source code editor for the web, written in JavaScript, HTML and CSS.
http://brackets.io
MIT License
33.27k stars 7.63k forks source link

ctrl+z (undo) doesn't work after save anymore since 1.5 #11826

Closed vankasteelj closed 7 years ago

vankasteelj commented 8 years ago

There's no way of reverting a change that was made if the file was saved. I don't know if that's a feature (saved=saved), but it's really annoying, especially when working with git. I had to reinstall 1.4 because of that, I cannot do any work without my "undo"^^

Windows 10 x86_64 Ubuntu 15.10 x64

EDIT: november 1st, 2016 : TL&DR; check out https://github.com/adobe/brackets/issues/11826#issuecomment-257429242

dacrhu commented 8 years ago

I use Fedora linux, in my Brackets working fine.

K-Thompson commented 8 years ago

I was getting ready to open the same issue but notice this post. I can confirm the same behavior with Windows 7 64 bit.

abose commented 8 years ago

Can you try debug>reload without extensions and see if the problem persists? Which extensions are installed in brackets?

jrtell1 commented 8 years ago

I got the exact same issue, with no extensions installed. Windows 10 64-bit

abose commented 8 years ago

Can you go to debug>show developer tools>console and comment the console logs here after undo fails?

jrtell1 commented 8 years ago

I think this is what you meant:

Download the React DevTools for a better development experience: http://fb.me/react-devtools

/utils/DeprecationWarning.js:90 PreferencesManager.convertPreferences() has been deprecated. Please upgrade to the current Preferences system (https://github.com/adobe/brackets/wiki/Preferences-System#conversion-from-the-pre-36-preferences-system).
    at Object.convertPreferences (/preferences/PreferencesManager.js:325:28)
    at Object.eval (/utils/Resizer.js:548:24)
    at Object.context.execCb (file:///C:/Program%20Files%20(x86)

/command/Menus.js:820 Error setting menu item shortcut: 1
/command/Menus.js:820 (anonymous function)
/LiveDevelopment/MultiBrowserImpl/transports/NodeSocketTransport.js:87 NodeSocketTransport - start

file:///C:/Program%20Files%20(x86)/Brackets/www/SELECT%20*%20FROM%20custome…=%20:address%20AND%20postalcode%20=%20:postalcode%20AND%20city%20=%20:city Failed to load resource: net::ERR_FILE_NOT_FOUND
jrtell1 commented 8 years ago

When I save the document seems to be flashing quickly, just as if I would open it anew. Maybe there's something that causes the document to be refreshed/reloaded? And therefore flushes the undo history?

abose commented 8 years ago

Are you working with live preview when this happens?

jrtell1 commented 8 years ago

Nope :)

abose commented 8 years ago

/command/Menus.js:820 Error setting menu item shortcut: 1 Can you try debug>reload without extensions just to be sure.

jrtell1 commented 8 years ago

Hm, that worked, surprisingly. The document doesn't appear to be reloading now after being saved. And undo works. Huzzah! What's odd is that I haven't installed any extensions.

abose commented 8 years ago

deleting %appdata%/brackets folder should fix it then.

jrtell1 commented 8 years ago

Yup, that did it. Great :D

vankasteelj commented 8 years ago

I will try that and make sure to report back.

igormakovsky commented 8 years ago

Can confirm the same issue on macOS Yosemite (10.10.5)

vankasteelj commented 8 years ago

Ok, deleting %appdata%\Brackets solved the issue. I re-installed all my extensions and it still works. So maybe deleting everything isn't needed, like only 1 precise file?

The only change between 1.4 and 1.5 I had before encountering the error was to install Extract and ExportPDF. Maybe the issue comes from there?

Just in case it helps, here's a list of the extensions installed before I deleted the entire AppData folder: 2015-10-16_13-45-21 2015-10-16_13-45-34 2015-10-16_13-45-41

vankasteelj commented 8 years ago

Aaaand the issue is back. It's a bug, definitively. It worked for a few hours and now it does not.

josephlimb commented 8 years ago

Same issue here: Ubuntu 14.04, Brackets 1.5

codingyourlife commented 8 years ago

My undo history got cleared every time I saved (v1.5). debug>reload without plugins helped. Even after saying debug>reload with plugins it kept working again. I didn't uninstall the old version, just installed v1.5.

Rainbowlemon commented 8 years ago

I'm getting the same issue. Reloading without extensions fixes it (though I've not been using it for long). This only applies to my Windows 10 64bit install - I've not got this problem on OSX.

abose commented 8 years ago

Did this happen only after upgrading to 1.5?

Rainbowlemon commented 8 years ago

Yeah, I just upgraded from 1.4 and encountered it in the first document I edited.

TonyPeterson commented 8 years ago

Ditto... I'm only experiencing it in my JS files tho, not my HTML or SCSS.

noreliq commented 8 years ago

Happening with PHP files

Only happened after updating to 1.5

Release 1.5 build 1.5.0-16538 (release cf9cf4698) Windows 7

chris-thorn commented 8 years ago

Same here. Only tried with PHP files so far.

Debug > Reload Without Extensions has so far fixed the issue, but it's only been minutes since I've done that.

Upgrade from 1.4 to 1.5.0-16538 (release cf9cf4698).

Windows 10 Pro 64-bit

abose commented 8 years ago

We are looking into this issue on priority.

thany commented 8 years ago

Same here, with javascript files so far. Windows 7 x64, version 1.5.0. No problems in 1.4.0.

I'll have to revert to 1.4.0 for the moment. This bug is costing me too much real work.

vankasteelj commented 8 years ago

Ah yes, I had not thought about detailing: I'm also using Javascript files, as I do not use Brackets for other langs.

abose commented 8 years ago

I am still not able to reproduce this in any of my machines. Does this issue go away after restarting brackets?

vankasteelj commented 8 years ago

I have a little time, I'll do some testing and report back various cases and if or not I encountered the issue.

EDIT: well, I have no idea how to reproduce, I tried with different files & folders. I'm unable to reproduce atm, so maybe it even is totally random? Really no idea...

EDIT2: I have been using 1.5 for around 4 hours now, still not able to reproduce. Maybe because the bug I encountered was while using "large" folder (I'm in a project with about 15 light files, when I had this bug twice, I was working on a 15mb repository)?

thany commented 8 years ago

Well then, let's list the plugins I'm using:

brackets-angularjs-codehints
brackets-apache-syntax
brackets-display-shortcuts
brackets-indent-guides
brackets-lorem-ipsum
brackets-morecsscodehints
brackets-mystique-theme
brackets-oncopy
brackets-php-syntax-hint
brackets-scss-lint
brackets-various-improvements
camden.jshint
de.richter.brackets.jsonlint
denisov21.pop-up-menu-extension
dnbard.extensions-rating
drewkoch.icons
fede91.brackets-preferences-ui
gruehle.markdown-preview
hirse.outline-list
html-block-selector
io.brackets.svg-code-hints
ivogabe.icons
jeffbooher.bookmarks
lonelystorm.newline
mikaeljorhult.brackets-todo
nicolo-ribaudo.brackets-svg-font
petetnt.brackets-name-a-project
pflynn.charcount
pflynn.svg.preview
sasshints
scrollfix
soft-dark
talmand.disable-autoclose-tags
torin.duplicate

Maybe one of them is messing up Brackets somehow. The theme I'm using is soft-dark, but surely this shouldn't make a difference.

Hope this helps.

ggat commented 8 years ago

Same problem after update from 1.4 to 1.5, Ubuntu 14.04.3 LTS.

debug>reload without extensions, helped in my case too, but I don't have any extensions installed, that seems strange to me.

jesper commented 8 years ago

Same issue here after the upgrade to 1.5 on (k)ubuntu. Any details/etc I can provide to help debug it?

abose commented 8 years ago

Can you consistently reproduce this issue? Also once this problem happens. goto edit menu and see the shortcut assigned for undo is ctrl+z

vankasteelj commented 8 years ago

I haven't been able to really narrow down the possibilities, but here's my feeling:

It seems quite random, but happens with large projects (> 2.5MB) when a lot of modifications & savings are done on multiple files (> 5 files opened at once). I wonder if it wouldn't have to do with the autocompletion of (), {}, [] and such, but have no evidence of it. It could maybe also be relative to something that happens sometimes, when Brackets "representation of project" (tree in the panel) seems "out of sync" with the real project (hdd). It happened on 1.4 that I had a warning popup "this file and the one on your local drive arent the same: load from hard drive - save - cancel", and I think I haven't seen that on 1.5 so it might be related somehow.

As I said, only a feeling, as I've tested for half an hour different scenarii to reproduce and haven't been able to, but yesterday it happened while I was really working (a bug that can only happen if you don't 'pretend' to work, so it can preserve itself from destruction? evolution is a $#!@^^)

thany commented 8 years ago

It's a quantum bug. One that exists and doesn't exist at the same time :)

But yes, you need to be actually working. But once it's triggered, undo should stop working reproducibly. So perhaps it is possible to work backwards from there.

joealmeida commented 8 years ago

Hello guys.

I'm having the same issue. But the only way I found to replicate it:

If you undo it will work.

Once you go back to brackets the undo won't work anymore.

thany commented 8 years ago

I do wonder why the fix for the issue is planned for 1.6... This bug makes 1.5 unusable. So I suggest this calls for a 1.5.1 maintenance release.

abose commented 8 years ago

We still are not able to repro this bug. Steps mentioned by @knifir does not help! Can anyone else see the same behavior with the steps mentioned?

joealmeida commented 8 years ago

@abose been trying with the steps I've said. And sometimes it happens, sometimes it doesn't. Weird.

thany commented 8 years ago

You could try working backwards. Is there any reason why the undo-history might get resetted? If so, then remove those causes and let us test if it helps.

abose commented 8 years ago

Undo history can be wiped out if the file is changed in the background, say by some other program.

thany commented 8 years ago

Clearly, there are other causes for wiping the undo history... Or, Brackets unnecessarily thinks the file has changed in the background.

manoharprabhu commented 8 years ago

I could reproduce this with following steps. 1) Create a new document and save it to disk. 2) Copy something to the clipboard and rapidly keep pressing Ctrl + V , Ctrl + S in that order (paste and save) 3) At one point it prompts the user to overwrite changes because the file has been modified outside brackets. Here the undo history is lost. This happens if the document already has a lot of content (10000+ lines) or the clipboard has lot of content.

Does windows file indexing mess with the document state?

SteveChab commented 8 years ago

I don't get a prompt. And I'm on a Mac. So that's probably a different issue? On Nov 2, 2015 11:46 PM, "Manohar Prabhu" notifications@github.com wrote:

I could reproduce this with following steps. 1) Create a new document and save it to disk. 2) Copy something to the clipboard and rapidly keep pressing Ctrl + V , Ctrl + S in that order (paste and save) 3) At one point it prompts the user to overwrite changes because the file has been modified outside brackets. Here the undo history is lost. This happens if the document already has a lot of content (10000+ lines) or the clipboard has lot of content.

Does windows file indexing mess with the document state?

— Reply to this email directly or view it on GitHub https://github.com/adobe/brackets/issues/11826#issuecomment-153237427.

turbalan commented 8 years ago

I am having this issue on Brackets 1.5; Ubuntu 14.04 with JS files and Scss files. I read through the thread and decided to check my extensions. While going through the list I saw the "Go to Matching Bracket". I've never used it as the shortcuts are the same as Ubuntu's go to different desktop, so I removed it and restarted Brackets.

Currently the problem's gone. I will post if it reappears.

petetnt commented 8 years ago

I ran into this issue yesterday too, it happened after I launched a second instance of Brackets. I tried to repro it but couldn't: after closing all the Brackets sessions everything went back to normal.

ggat commented 8 years ago

@petetnt you remainded me about my second problem on Ubuntu gnome, from day I installed brackets it requires cross button to be clicked two times to close the program no matter files are saved or not. Maybe it have relation with two instances and with this issue.

petetnt commented 8 years ago

@ggat That is an older, separate issue that has had a fix pending for a long time (related issue #4611). If you have Linux native coding background (or know someone who does and would be interested in contributing to Brackets) help would be appreciated (with various Linux related things).

thany commented 8 years ago

Any progress on this issue?

Honestly, for a bug this severe I would pull down the release and fix it before it gets re-released. After all, a bug like this may destroy work.