MCPcopy
hub / github.com/peco/peco / TopDownQueryBottomLayout

Function TopDownQueryBottomLayout

layout.go:847–866  ·  view source on GitHub ↗

TopDownQueryBottomLayout creates a Layout with list top-to-bottom and the query prompt at the bottom.

(state *Peco)

Source from the content-addressed store, hash-verified

845// TopDownQueryBottomLayout creates a Layout with list top-to-bottom
846// and the query prompt at the bottom.
847func TopDownQueryBottomLayout(state *Peco) (*BasicLayout, error) {
848 sb, err := newStatusBar(state)
849 if err != nil {
850 return nil, err
851 }
852 prompt, err := NewUserPrompt(state.Screen(), AnchorBottom, 1+extraOffset, state.Prompt(), state.Styles())
853 if err != nil {
854 return nil, err
855 }
856 list, err := NewListArea(state.Screen(), AnchorTop, 0, true, state.Styles())
857 if err != nil {
858 return nil, err
859 }
860 return &BasicLayout{
861 statusBar: sb,
862 screen: state.Screen(),
863 prompt: prompt,
864 list: list,
865 }, nil
866}
867
868// SortTopDown returns whether this layout sorts lines from top to bottom.
869func (l *BasicLayout) SortTopDown() bool {

Callers 1

Calls 6

newStatusBarFunction · 0.85
NewUserPromptFunction · 0.85
NewListAreaFunction · 0.85
ScreenMethod · 0.80
PromptMethod · 0.80
StylesMethod · 0.80

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…