Skip to content

Commit d5e1575

Browse files
committed
More fixes
1 parent 7bcbfd7 commit d5e1575

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

src/app.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,14 @@ impl eframe::App for App {
200200

201201
// Windows + request_repaint_after breaks dialogs:
202202
// https://github.com/emilk/egui/issues/2003
203-
if cfg!(windows) || view_state.jobs.iter().any(|job| {
204-
if let Some(handle) = &job.handle {
205-
return !handle.is_finished();
206-
}
207-
false
208-
}) {
203+
if cfg!(windows)
204+
|| view_state.jobs.iter().any(|job| {
205+
if let Some(handle) = &job.handle {
206+
return !handle.is_finished();
207+
}
208+
false
209+
})
210+
{
209211
ctx.request_repaint();
210212
} else {
211213
ctx.request_repaint_after(Duration::from_millis(100));

src/jobs/build.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ fn run_make(cwd: &Path, arg: &Path, config: &AppConfig) -> BuildStatus {
3030
match (|| -> Result<BuildStatus> {
3131
let make = if config.custom_make.is_empty() { "make" } else { &config.custom_make };
3232
#[cfg(not(windows))]
33-
{
33+
let mut command = {
3434
let mut command = Command::new(make);
3535
command.current_dir(cwd).arg(arg);
3636
command
37-
}
37+
};
3838
#[cfg(windows)]
3939
let mut command = {
40-
use path_slash::PathExt;
4140
use std::os::windows::process::CommandExt;
41+
42+
use path_slash::PathExt;
4243
let mut command = if config.selected_wsl_distro.is_some() {
4344
Command::new("wsl")
4445
} else {

src/views/config.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
use std::process::Command;
1+
#[cfg(windows)]
22
use std::string::FromUtf16Error;
33
use std::sync::{Arc, RwLock};
44

5+
#[cfg(windows)]
56
use anyhow::{Context, Result};
67

78
use crate::{
@@ -20,7 +21,7 @@ fn process_utf16(bytes: &[u8]) -> Result<String, FromUtf16Error> {
2021

2122
#[cfg(windows)]
2223
fn wsl_cmd(args: &[&str]) -> Result<String> {
23-
use std::os::windows::process::CommandExt;
24+
use std::{os::windows::process::CommandExt, process::Command};
2425
let output = Command::new("wsl")
2526
.args(args)
2627
.creation_flags(winapi::um::winbase::CREATE_NO_WINDOW)
@@ -73,6 +74,11 @@ pub fn config_ui(ui: &mut egui::Ui, config: &Arc<RwLock<AppConfig>>, view_state:
7374
}
7475
});
7576
}
77+
#[cfg(not(windows))]
78+
{
79+
let _ = available_wsl_distros;
80+
let _ = selected_wsl_distro;
81+
}
7682

7783
ui.label("Custom make program:");
7884
ui.text_edit_singleline(custom_make);

0 commit comments

Comments
 (0)