Skip to content
Myr

Redraw prompt only when necessary

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 82efe6c · Browse files · 1 file+8 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−2 removed

  • other:+8 added−2 removed

1 file+8 added−2 removed

modified:src/terminal.go+8 added-2 removed
1633 unmodified lines
1634 event := t.tui.GetChar()16351636 t.mutex.Lock()1637 previousInput := t.input1638 previousCx := t.cx1638 events := []util.EventType{reqPrompt}1639 events := []util.EventType{}1640 req := func(evts ...util.EventType) {1641 for _, event := range evts {1642 events = append(events, event)1643 if event == reqClose || event == reqQuit {
352 unmodified lines
1996 }1997 t.jumping = jumpDisabled1998 req(reqList)1999 }1999 t.mutex.Unlock() // Must be unlocked before touching reqBox20002001 if changed {2002 if t.isPreviewEnabled() {2003 _, q := hasPreviewFlags(t.preview.command)
2 unmodified lines
2006 }2007 }2008 t.eventBox.Set(EvtSearchNew, t.sort)2009 }20102011 if changed || t.cx != previousCx {2012 req(reqPrompt)2013 }20142015 t.mutex.Unlock() // Must be unlocked before touching reqBox2016 for _, event := range events {2017 t.reqBox.Set(event, nil)2018 }2019 }
49 unmodified lines