Skip to content

Commit

Permalink
fix unwraps due to not having a lsp-able file open
Browse files Browse the repository at this point in the history
  • Loading branch information
Redhawk18 committed Sep 30, 2024
1 parent 8bbffa0 commit 8362f83
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions gui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ impl Kuiper {
}
}
Button::SavedAs(_) => {}
// Button::Quit => return iced::window::close(0),
Button::Quit => todo!(),
},
Widgets::PaneGrid(pane_grid) => match pane_grid {
Expand Down Expand Up @@ -212,11 +211,28 @@ impl Kuiper {
match buffer {
Buffer::File(buffer) => {
buffer.content.perform(action);
let path = buffer.path.clone().unwrap();
return Task::perform(
synchronize(path, self.lsp_client.clone().unwrap().socket),
|x| Message::LanguageServer(LanguageServer::Syncronize(x)),
);

let path: PathBuf;
match &buffer.path {
Some(pathbuf) => path = pathbuf.to_path_buf(),
None => {
return Task::none();
}
}

match &self.lsp_client {
Some(client) => {
return Task::perform(
synchronize(path, client.clone().socket),
|x| {
Message::LanguageServer(LanguageServer::Syncronize(
x,
))
},
);
}
None => {}
}
}
}
}
Expand Down

0 comments on commit 8362f83

Please sign in to comment.