From 545d553d1a2a837137c4b3305d59b65412f6c19e Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Wed, 28 Aug 2024 00:56:40 -0400 Subject: [PATCH] Config impl watches for create *and* write Editing config files with things like gedit work now --- config/impl.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/impl.go b/config/impl.go index 758c762..b24c753 100644 --- a/config/impl.go +++ b/config/impl.go @@ -65,8 +65,8 @@ func NewConfig (user string, system ...string) (ConfigCloser, error) { func (this *config) lockAndProcessEvent (event fsnotify.Event) { this.lock.Lock() defer this.lock.Unlock() - if !(event.Has(fsnotify.Write)) { return } - if _, ok := this.paths.watching[event.Name]; !ok { return } + if !(event.Has(fsnotify.Write | fsnotify.Create)) { return } + if _, ok := this.paths.watching[event.Name]; !ok { return } if event.Name == this.paths.user { if !this.ignoreNextUserUpdate {