mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
cf254f22a3
commit
0d5a5d1212
3 changed files with 15 additions and 14 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use core::{emit, files::FilesOp, input::InputMode, Event};
|
||||
use std::ffi::OsString;
|
||||
|
||||
use anyhow::{Ok, Result};
|
||||
use config::{keymap::{Control, Key, KeymapLayer}, BOOT};
|
||||
|
|
@ -182,7 +183,15 @@ impl App {
|
|||
s
|
||||
});
|
||||
|
||||
std::fs::write(p, paths.as_bytes()).ok();
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
std::fs::write(p, paths.to_string_lossy().as_bytes()).ok();
|
||||
}
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
{
|
||||
use std::os::unix::ffi::OsStrExt;
|
||||
std::fs::write(p, paths.as_bytes()).ok();
|
||||
}
|
||||
return emit!(Quit);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ impl Default for Boot {
|
|||
let boot = Self {
|
||||
cwd: cwd.unwrap_or("/".into()),
|
||||
cache_dir: env::temp_dir().join("yazi"),
|
||||
state_dir: xdg::BaseDirectories::with_prefix("yazi").unwrap().get_state_home(),
|
||||
state_dir: Xdg::state_dir().unwrap(),
|
||||
|
||||
cwd_file: args.cwd_file,
|
||||
chooser_file: args.chooser_file,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
use anyhow::Result;
|
||||
use std::io::{stdout, Write};
|
||||
|
||||
use crossterm::{
|
||||
cursor::{self, MoveTo, RestorePosition, SavePosition, SetCursorStyle},
|
||||
execute, queue,
|
||||
terminal::{Clear, ClearType},
|
||||
};
|
||||
use anyhow::Result;
|
||||
use crossterm::{cursor::{MoveTo, RestorePosition, SavePosition, SetCursorStyle}, execute, queue, terminal::{Clear, ClearType}};
|
||||
|
||||
use crate::Term;
|
||||
|
||||
|
|
@ -45,12 +41,8 @@ impl Term {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_cursor_block() -> Result<()> {
|
||||
Ok(execute!(stdout(), SetCursorStyle::BlinkingBlock)?)
|
||||
}
|
||||
pub fn set_cursor_block() -> Result<()> { Ok(execute!(stdout(), SetCursorStyle::BlinkingBlock)?) }
|
||||
|
||||
#[inline]
|
||||
pub fn set_cursor_bar() -> Result<()> {
|
||||
Ok(execute!(stdout(), SetCursorStyle::BlinkingBar)?)
|
||||
}
|
||||
pub fn set_cursor_bar() -> Result<()> { Ok(execute!(stdout(), SetCursorStyle::BlinkingBar)?) }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue