Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Easy to hit Reload by accident, losing Undo history for files that don't have unsaved changes #10222

Open
vuhrmeister opened this issue Dec 18, 2014 · 7 comments

Comments

@vuhrmeister
Copy link

It often happen to me that I accidentally reload brackets by pressing cmd + R.
As soon I have saved my changes I want to preview them in the browser and therefore I reload it. Accidentally often the focus is not fast enough on the browser and then the reload happens on brackets.

As a result of that issue I loose my edit history so that undoing changes does not take effect. And since brackets does not have a local history that really sucks.

I don't know what's best solution for that, but that makes working very frustrating. Maybe there is some other trick to avoid this somehow.

BTW: I'm on Mac. On Linux I didn't hat that issue. Probably mac does not switch focus fast enough.

@redmunds
Copy link
Contributor

@ufisch One thing you can do is to undefine the cmd + R shortcut in Brackets. Use Debug > Open User Key Map then set that shortcut to null.

@vuhrmeister
Copy link
Author

thx, that's at least a good quick fix.

I also had the feeling that the edit history was gone without reloading. But will keep an eye on it if it was just this reload issue.

@peterflynn
Copy link
Member

This has nothing to do with the native shell, so removing that tag.

There are really two, somewhat separable pieces here:

  • The Reload shortcut is easy to hit by accident (and sometimes has misled people into thinking it reloads the browser instead of Brackets itself). We've talked a little about having the Debug menu hidden by default unless you turn on a 'developer mode'... Or we could also have no shortcut by default (or a different shortcut), though that only fixes the accidental case and not the misleading case.
  • If you do reload Brackets, or quit & relaunch, etc., it would be cool if the Undo history were preserved -- or a more coarse-grained 'local history' at least. Local history is on the backlog already. I'm not aware of any editor that preserves the full Undo history (not even Sublime, which preserves unsaved changes but not Undo/Redo history), so I'm guessing we're unlikely to invest in a feature like that.

IMHO we should focus this bug on the first bullet, since that seems to be the more salient issue... and leave the existing backlog item to track the second bullet.

@peterflynn peterflynn changed the title Keep edit history on app reload Easy to hit Reload by accident, losing Undo history for files that don't have unsaved changes Jan 22, 2015
@peterflynn
Copy link
Member

Edited title to align with that

@peterflynn
Copy link
Member

In the past we've talked about having the Debug menu hidden by default, which should disable troublesome shortcuts like that as well as avoid user confusion over the other items in this menu (e.g. #10688). That would be one route to fixing this.

@gobijan
Copy link

gobijan commented May 25, 2016

You guys do an awesome job with brackets! Thank you for your effort :)

One thing:
Hitting CMD+R to reload the app is a poor default behavior and the shortcut to it should be removed.

Reasons:

  • You don't expect a native app to reload when hitting the browsers reload command.
  • CMD + E offers nice inline css editing in an html file (one of brackets biggest strength) and it is sometimes easy to hit CMD + R because E is next to R by accident (happened to me a million times).

Fixed it with the following keymap:

{
    "documentation": "https://github.com/adobe/brackets/wiki/User-Key-Bindings",
    "overrides": {
        "CMD-R": null
    }
}

@nyteksf
Copy link
Contributor

nyteksf commented Jun 14, 2018

Hello. I've made two PRs implementing the changes suggested above by @peterflynn. Those suggested changes were to make the debug menu hidden by default preference, and otherwise allowing persistence between brackets sessions for undo/redo history also by preference. That said, if I were to ask, could somebody please take a look at them whenever they get a chance in order to let me know if any changes need to be made on review? Thanks in advance; whatever the case.

@peterflynn @redmunds @zaggino @petetnt

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants