Compare commits

...

2 Commits

Author SHA1 Message Date
Dmitriy Kovalenko 617fb0cdf1 chore: Update docs for - fix: Macos background watcher memory usage
docs / docs (push) Has been cancelled
2026-02-20 00:22:24 +00:00
Dmitriy Kovalenko 911f5c4d6e fix: Macos background watcher memory usage
closes https://github.com/dmtrKovalenko/fff.nvim/issues/239

Fixes a memory leak of the backgorund watcher on macos when the internal
fsevents buffer is droping certain elements
2026-02-19 16:20:37 -08:00
2 changed files with 11 additions and 6 deletions
+7 -5
View File
@@ -6,15 +6,13 @@ use crate::{SharedFrecency, SharedPicker};
use git2::Repository;
use notify::event::{AccessKind, AccessMode};
use notify::{Config, EventKind, RecursiveMode};
use notify_debouncer_full::{
DebounceEventResult, DebouncedEvent, RecommendedCache, new_debouncer_opt,
};
use notify_debouncer_full::{DebounceEventResult, DebouncedEvent, NoCache, new_debouncer_opt};
use std::path::{Path, PathBuf};
use std::sync::{Arc, Mutex};
use std::time::Duration;
use tracing::{Level, debug, error, info, warn};
type Debouncer = notify_debouncer_full::Debouncer<notify::RecommendedWatcher, RecommendedCache>;
type Debouncer = notify_debouncer_full::Debouncer<notify::RecommendedWatcher, NoCache>;
pub struct BackgroundWatcher {
debouncer: Arc<Mutex<Option<Debouncer>>>,
@@ -75,7 +73,11 @@ impl BackgroundWatcher {
}
}
},
RecommendedCache::new(),
// There is an issue with recommended cache implementation on macos
// it keeps track of all the files added to the watcher which is not a problem
// for us because any rename to the file will anyway require the removing from the
// ordedred index and adding it back with the new name
NoCache::new(),
config,
)?;
+4 -1
View File
@@ -1,4 +1,4 @@
*fff.nvim.txt* For Neovim >= 0.10.0 Last change: 2026 February 19
*fff.nvim.txt* For Neovim >= 0.10.0 Last change: 2026 February 20
==============================================================================
Table of Contents *fff.nvim-table-of-contents*
@@ -365,6 +365,9 @@ your configuration, or per-call when invoking `live_grep()`.
modes = { 'fuzzy' },
}
})
-- Pre-fill the search with an initial query
require('fff').live_grep({ query = 'search term' })
<
When only one mode is configured, the mode indicator is hidden completely and