diff --git a/lapce-app/src/app.rs b/lapce-app/src/app.rs index 30d75c10..1b028b54 100644 --- a/lapce-app/src/app.rs +++ b/lapce-app/src/app.rs @@ -4034,8 +4034,10 @@ pub fn try_open_in_existing_process( fn listen_local_socket(tx: Sender) -> Result<()> { let local_socket = Directory::local_socket() .ok_or_else(|| anyhow!("can't get local socket folder"))?; - if let Err(err) = std::fs::remove_file(&local_socket) { - tracing::error!("{:?}", err); + if local_socket.exists() { + if let Err(err) = std::fs::remove_file(&local_socket) { + tracing::error!("{:?}", err); + } } let socket = interprocess::local_socket::LocalSocketListener::bind(local_socket)?; diff --git a/lapce-core/src/language.rs b/lapce-core/src/language.rs index c2979253..9d0c95d2 100644 --- a/lapce-core/src/language.rs +++ b/lapce-core/src/language.rs @@ -1771,7 +1771,9 @@ fn get_grammar(&self) -> Option { return Some(grammar); } Err(err) => { - tracing::error!("{:?}", err); + if self != &LapceLanguage::PlainText { + tracing::error!("{:?} {:?}", self, err); + } } } };