mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
Remove file watcher code
Now that we refresh upon focus, we can scrap this file watching code. Stefan says few git UIs use file watching, and I understand why: the reason this code was problematic in the first place is that watching files is expensive and if you have too many open file handles that can cause problems. Importantly: this code that's being removed was _already_ dead.
This commit is contained in:
@ -72,7 +72,6 @@ type Gui struct {
|
||||
Updater *updates.Updater
|
||||
statusManager *status.StatusManager
|
||||
waitForIntro sync.WaitGroup
|
||||
fileWatcher *fileWatcher
|
||||
viewBufferManagerMap map[string]*tasks.ViewBufferManager
|
||||
// holds a mapping of view names to ptmx's. This is for rendering command outputs
|
||||
// from within a pty. The point of keeping track of them is so that if we re-size
|
||||
@ -476,8 +475,6 @@ func NewGui(
|
||||
afterLayoutFuncs: make(chan func() error, 1000),
|
||||
}
|
||||
|
||||
gui.WatchFilesForChanges()
|
||||
|
||||
gui.PopupHandler = popup.NewPopupHandler(
|
||||
cmn,
|
||||
func(ctx goContext.Context, opts types.CreatePopupPanelOpts) error {
|
||||
@ -680,10 +677,6 @@ func (gui *Gui) RunAndHandleError(startArgs appTypes.StartArgs) error {
|
||||
manager.Close()
|
||||
}
|
||||
|
||||
if !gui.fileWatcher.Disabled {
|
||||
gui.fileWatcher.Watcher.Close()
|
||||
}
|
||||
|
||||
close(gui.stopChan)
|
||||
|
||||
switch err {
|
||||
|
Reference in New Issue
Block a user