mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-03 17:44:30 +00:00
ssh: Don't erase the connection input on escape key (#19550)
This PR changes the behavior of pressing the `Esc` key on the connection input. Now, if you hit it, the address inserted into the input won't be erased. Effectively, escape now only cancels the connection process instead of doing both (clearing the input _and_ cancelling the connection). Release Notes: - N/A Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
This commit is contained in:
parent
bc9086c9af
commit
970f8db5c4
1 changed files with 7 additions and 1 deletions
|
@ -597,7 +597,13 @@ impl RemoteServerProjects {
|
|||
match &self.mode {
|
||||
Mode::Default(_) => cx.emit(DismissEvent),
|
||||
Mode::CreateRemoteServer(state) if state.ssh_prompt.is_some() => {
|
||||
self.mode = Mode::CreateRemoteServer(CreateRemoteServer::new(cx));
|
||||
let new_state = CreateRemoteServer::new(cx);
|
||||
let old_prompt = state.address_editor.read(cx).text(cx);
|
||||
new_state.address_editor.update(cx, |this, cx| {
|
||||
this.set_text(old_prompt, cx);
|
||||
});
|
||||
|
||||
self.mode = Mode::CreateRemoteServer(new_state);
|
||||
self.selectable_items.reset_selection();
|
||||
cx.notify();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue