8.3 KiB
Dialogs
Helder asks you something in three ways: a confirm dialog before a risky action, a small name prompt for new and renamed entries, and the macOS unsaved-changes alert. This page shows each one, what it says, and which keys answer it.
Guide index · Related: Right-click menu, Git, Explorer, File view, Notifications
At a glance
+----------------------------------------------------------------------------+
|//////////////////////////// dimmed window /////////////////////////////////|
|////////// +------------------------------------------------+ ////////////|
|////////// | (1) Discard changes to app/Http/User.php? | ////////////|
|////////// | | ////////////|
|////////// | (2) This reverts the file to the last commit | ////////////|
|////////// | and cannot be undone. | ////////////|
|////////// | | ////////////|
|////////// | (3)[ Cancel esc ] (4)[ Discard enter ] | ////////////|
|////////// +------------------------------------------------+ ////////////|
|////////////////////////////////////////////////////////////////////////////|
+----------------------------------------------------------------------------+
- Title: the question, often with the path it is about.
- Body: what will happen. Not every confirm dialog has one.
- Cancel: closes the dialog and does nothing. Its key is
Esc. - Confirm button: amber-deep, named after the action (Discard, Delete, Stage, Unstage). Its key is
Enter.
Features
Confirm dialog
The confirm dialog sits on top of a dimmed window. Nothing else takes keys while it is open.
Enteror a click on the confirm button runs the action.Esc, a click on Cancel, or a click on the dimmed area outside cancels. Nothing changes.
Helder shows a confirm dialog for these actions:
| Action | Title | Body | Button | When |
|---|---|---|---|---|
| Discard changes | Discard changes to <path>? |
This reverts the file to the last commit and cannot be undone. |
Discard | When git.confirmDiscard is on (default) |
| Stage changes | Stage <path>? |
none | Stage | Only when git.confirmStage is on |
| Unstage changes | Unstage <path>? |
none | Unstage | Only when git.confirmUnstage is on |
| Delete file | Delete file? |
<path> will be permanently deleted. |
Delete | Always |
| Delete folder | Delete folder? |
<path>/ and everything inside it will be permanently deleted. |
Delete | Always |
Discard changes
Comes from Discard changes on a Git row. On confirm, the file goes back to the last commit, both its staged and unstaged changes. A new file is deleted. An open copy in the File view reloads. A notification says Discarded changes.
Stage and unstage
Come from the hover + / − on a git row, or from the right-click menu, but only when you turned the matching setting on. Stage all and Unstage all never ask.
Delete file or folder
Comes from Delete file or Delete folder in the Explorer. It always asks. On confirm:
- The file, or the folder with everything inside it, is deleted for good. It does not go to the Trash.
- An open file that was deleted closes in the File view.
- A notification says
Deleted fileorDeleted folder, orDelete failed.
Name prompt
The name prompt is a small panel for New file, New folder, Rename file and Rename folder. It opens where the right-click menu stood. The window is not dimmed.
+------------------------------------------------+
| (1) [doc] New file (2)esc |
| +--------------------------------------------+ |
| | (3) file name... | |
| +--------------------------------------------+ |
| (4) creates [ app/Http/... ] |
| (5) enter create file esc cancel |
+------------------------------------------------+
- Title: a file or folder icon in amber, and
New file,New folder,Rename fileorRename folder. - Esc chip: a reminder that
Esccloses the prompt. - Name field: has the keyboard as soon as the prompt opens. The hint reads
file name…orfolder name…. - Preview: the path that
Enterwill produce, in an amber chip. It readscreatesfor a new entry andrenames tofor a rename. It shows…while the name cannot be used. - Footer: the keys:
↵ create file,↵ create folder,↵ rename fileor↵ rename folder, andesc cancel.
How it works:
- Type a name. The preview follows each key.
Entercreates or renames, then closes the prompt.Esc, or a click anywhere outside the panel, cancels.- For a rename, the field starts with the current name. Only the part before the extension is selected, so typing a new name keeps
.phpor.md.
What happens after Enter:
- New file: the file is created empty and opens in the File view. Its folders expand in the Explorer.
- New folder: the folder is created and expands.
- Rename: the entry gets its new name. An open file stays open under the new name.
- A notification confirms:
Created file,Created folder,Renamed fileorRenamed folder, with the new path.
Names the prompt accepts
There are no error messages inside the prompt. Instead, Enter does nothing while the preview shows …. That happens when:
- The name is empty or only spaces.
- For a rename: the name has a
/, is.or.., or is the same as the current name.
For New file and New folder, a name with slashes creates the folders on the way. tests/Unit/MathTest.php creates tests/Unit/ when it does not exist yet. Leading and trailing slashes are dropped. Spaces around the name are trimmed.
A rename that only changes capitals (readme.md to README.md) works.
When a file or folder with that name already exists, nothing is overwritten. The prompt closes and a notification says Create failed or Rename failed, with the name.
Unsaved changes
When the open file has unsaved edits and you are about to lose them, Helder shows the standard macOS alert:
+------------------------------------------------------+
| (!) Save changes to UserController.php? |
| |
| app/Http/UserController.php has unsaved edits. |
| They are lost if you close without saving. |
| |
| [ Save ] [ Don't Save ] [ Cancel ] |
+------------------------------------------------------+
It appears when you:
- open another file, or the same file again, from any place;
- close the file with
Cmd+W; - close the window or switch to another project. Each file with unsaved edits asks in turn.
The buttons:
- Save writes the file, then goes ahead. When the save fails, the file stays open and nothing else happens.
- Don't Save drops the edits and goes ahead.
- Cancel keeps the file, its edits and the selection in the Explorer. Nothing happens.
Enter picks Save, Esc picks Cancel, as in every macOS alert.
With editor.autoSave on, opening another file saves the open one silently, without this alert.
Keyboard
| Keys | Action |
|---|---|
Enter |
Confirm dialog: run the action. Name prompt: create or rename. Unsaved alert: Save |
Esc |
Cancel any of the three |
Settings
| Setting | Default | Effect |
|---|---|---|
git.confirmDiscard |
true |
Ask before Discard changes |
git.confirmStage |
false |
Ask before staging one file |
git.confirmUnstage |
false |
Ask before unstaging one file |
editor.autoSave |
false |
Save the open file silently instead of asking, when you open another file |
Related
- Right-click menu: where most of these dialogs start.
- Git: discard, stage and unstage.
- Explorer: new, rename and delete.
- File view: saving, and the unsaved-edits dot.
- Notifications: the message after each action.
- Configuration: where the settings live.