mirror of https://github.com/lapce/lapce.git
file watcher fix
This commit is contained in:
parent
716ce46fc4
commit
8878820030
|
@ -237,8 +237,13 @@ pub fn send_notification(&self, method: &str, params: Value) {
|
|||
}
|
||||
|
||||
fn handle_fs_events(&self) {
|
||||
let mut events =
|
||||
{ self.file_watcher.lock().as_mut().unwrap().take_events() };
|
||||
let mut events = {
|
||||
self.file_watcher
|
||||
.lock()
|
||||
.as_mut()
|
||||
.map(|w| w.take_events())
|
||||
.unwrap_or_default()
|
||||
};
|
||||
|
||||
for (token, event) in events.drain(..) {
|
||||
match token {
|
||||
|
|
Loading…
Reference in New Issue