mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 05:15:00 +00:00
First draft for opening Zed.log
This commit is contained in:
parent
20d45221c9
commit
b20aefc842
1 changed files with 11 additions and 3 deletions
|
@ -52,6 +52,7 @@ actions!(
|
||||||
Quit,
|
Quit,
|
||||||
DebugElements,
|
DebugElements,
|
||||||
OpenSettings,
|
OpenSettings,
|
||||||
|
OpenLog,
|
||||||
OpenKeymap,
|
OpenKeymap,
|
||||||
OpenDefaultSettings,
|
OpenDefaultSettings,
|
||||||
OpenDefaultKeymap,
|
OpenDefaultKeymap,
|
||||||
|
@ -65,9 +66,10 @@ actions!(
|
||||||
const MIN_FONT_SIZE: f32 = 6.0;
|
const MIN_FONT_SIZE: f32 = 6.0;
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref ROOT_PATH: PathBuf = dirs::home_dir()
|
pub static ref HOME_PATH: PathBuf =
|
||||||
.expect("failed to determine home directory")
|
dirs::home_dir().expect("failed to determine home directory");
|
||||||
.join(".zed");
|
pub static ref LOG_PATH: PathBuf = HOME_PATH.join("Library/Logs/Zed/Zed.log");
|
||||||
|
pub static ref ROOT_PATH: PathBuf = HOME_PATH.join(".zed");
|
||||||
pub static ref SETTINGS_PATH: PathBuf = ROOT_PATH.join("settings.json");
|
pub static ref SETTINGS_PATH: PathBuf = ROOT_PATH.join("settings.json");
|
||||||
pub static ref KEYMAP_PATH: PathBuf = ROOT_PATH.join("keymap.json");
|
pub static ref KEYMAP_PATH: PathBuf = ROOT_PATH.join("keymap.json");
|
||||||
}
|
}
|
||||||
|
@ -120,6 +122,12 @@ pub fn init(app_state: &Arc<AppState>, cx: &mut gpui::MutableAppContext) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
cx.add_action({
|
||||||
|
let app_state = app_state.clone();
|
||||||
|
move |_: &mut Workspace, _: &OpenLog, cx: &mut ViewContext<Workspace>| {
|
||||||
|
open_config_file(&LOG_PATH, app_state.clone(), cx, || Default::default());
|
||||||
|
}
|
||||||
|
});
|
||||||
cx.add_action({
|
cx.add_action({
|
||||||
let app_state = app_state.clone();
|
let app_state = app_state.clone();
|
||||||
move |_: &mut Workspace, _: &OpenKeymap, cx: &mut ViewContext<Workspace>| {
|
move |_: &mut Workspace, _: &OpenKeymap, cx: &mut ViewContext<Workspace>| {
|
||||||
|
|
Loading…
Reference in a new issue