Skip to content
Myr

Fix Windows build

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

Fix #3598

authored by Junegunn Choi · committed by Junegunn Choi · parent beb2de2 · Browse files · 5 files+30 added−10 removed
This commit

State

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

Diff stats

5 files+30 added−10 removed

  • other:+30 added−10 removed

5 files+30 added−10 removed

modified:src/tui/dummy.go+1 added
34 unmodified lines
35func (r *FullscreenRenderer) Resume(bool, bool) {}36func (r *FullscreenRenderer) PassThrough(string) {}37func (r *FullscreenRenderer) Clear() {}38func (r *FullscreenRenderer) NeedScrollbarRedraw() bool { return false }39func (r *FullscreenRenderer) ShouldEmitResizeEvent() bool { return false }40func (r *FullscreenRenderer) Refresh() {}41func (r *FullscreenRenderer) Close() {}42func (r *FullscreenRenderer) Size() TermSize { return TermSize{} }43
10 unmodified lines
modified:src/tui/light.go+4 added
692 unmodified lines
693func (r *LightRenderer) NeedScrollbarRedraw() bool {694 return false695}696697func (r *LightRenderer) ShouldEmitResizeEvent() bool {698 return false699}700701func (r *LightRenderer) RefreshWindows(windows []Window) {702 r.flush()703}704
418 unmodified lines
modified:src/tui/tcell.go+4 added
200 unmodified lines
201func (r *FullscreenRenderer) NeedScrollbarRedraw() bool {202 return true203}204205func (r *FullscreenRenderer) ShouldEmitResizeEvent() bool {206 return true207}208209func (r *FullscreenRenderer) Refresh() {210 // noop211}212
580 unmodified lines
modified:src/tui/tui.go+1 added
492 unmodified lines
493 Refresh()494 Close()495 PassThrough(string)496 NeedScrollbarRedraw() bool497 ShouldEmitResizeEvent() bool498499 GetChar() Event500501 Top() int
320 unmodified lines
modified:src/terminal.go+20 added-10 removed
815 unmodified lines
816 }817 }818 }819820 var resizeActions []*action820 _, t.hasResizeActions = t.keymap[tui.Resize.AsEvent()]821 resizeActions, t.hasResizeActions = t.keymap[tui.Resize.AsEvent()]822 if t.tui.ShouldEmitResizeEvent() {823 t.keymap[tui.Resize.AsEvent()] = append(toActions(actClearScreen), resizeActions...)824 }825 _, t.hasResultActions = t.keymap[tui.Result.AsEvent()]826 _, t.hasFocusActions = t.keymap[tui.Focus.AsEvent()]827 _, t.hasLoadActions = t.keymap[tui.Load.AsEvent()]828
2026 unmodified lines
2855 t.reqBox.Set(reqReinit, nil)2856 }2857 }()28582859 if !t.tui.ShouldEmitResizeEvent() {2855 resizeChan := make(chan os.Signal, 1)2856 notifyOnResize(resizeChan) // Non-portable2857 go func() {2858 for {2859 <-resizeChan2860 t.reqBox.Set(reqResize, nil)2861 }2862 }()2860 resizeChan := make(chan os.Signal, 1)2861 notifyOnResize(resizeChan) // Non-portable2862 go func() {2863 for {2864 <-resizeChan2865 t.reqBox.Set(reqResize, nil)2866 }2867 }()2868 }28692870 t.mutex.Lock()2871 t.initFunc()2872 t.termSize = t.tui.Size()
347 unmodified lines
3220 barrier <- true3221 }3222 select {3223 case event = <-t.eventChan:3224 if t.tui.ShouldEmitResizeEvent() {3225 needBarrier = !event.Is(tui.Load, tui.Result, tui.Focus, tui.One, tui.Zero)3226 } else {3218 needBarrier = !event.Is(tui.Load, tui.Result, tui.Focus, tui.One, tui.Zero, tui.Resize)3227 needBarrier = !event.Is(tui.Load, tui.Result, tui.Focus, tui.One, tui.Zero, tui.Resize)3228 }3229 case serverActions := <-t.serverInputChan:3230 event = tui.Invalid.AsEvent()3231 if t.listenAddr == nil || t.listenAddr.IsLocal() || t.listenUnsafe {3232 actions = serverActions
965 unmodified lines