A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/jesseduffield/lazygit/commit/898f5651163d8ff9a28889003450872a1b27f29f below:

Fix delay with flicking through files or commits when git diff is ver… · jesseduffield/lazygit@898f565 · GitHub

File tree Expand file treeCollapse file tree 1 file changed

+9

-5

lines changed

Filter options

Expand file treeCollapse file tree 1 file changed

+9

-5

lines changed Original file line number Diff line number Diff line change

@@ -291,11 +291,15 @@ func (self *ViewBufferManager) NewCmdTask(start func() (*exec.Cmd, io.Reader), p

291 291 292 292

refreshViewIfStale()

293 293 294 -

if err := cmd.Wait(); err != nil {

295 -

select {

296 -

case <-opts.Stop:

297 -

// it's fine if we've killed this program ourselves

298 -

default:

294 +

select {

295 +

case <-opts.Stop:

296 +

// If we stopped the task, don't block waiting for it; this could cause a delay if

297 +

// the process takes a while until it actually terminates. We still want to call

298 +

// Wait to reclaim any resources, but do it on a background goroutine, and ignore

299 +

// any errors.

300 +

go func() { _ = cmd.Wait() }()

301 +

default:

302 +

if err := cmd.Wait(); err != nil {

299 303

self.Log.Errorf("Unexpected error when running cmd task: %v; Failed command: %v %v", err, cmd.Path, cmd.Args)

300 304

}

301 305

}

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4