MCPcopy Index your code
hub / github.com/chip/pathos / initialModel

Function initialModel

pathos.go:115–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113}
114
115func initialModel() model {
116 ti := setupTextInput()
117
118 items := createPaths()
119 duplicatePaths = findDuplicatePaths(items)
120
121 const defaultWidth = 60
122
123 l := list.New(items, itemDelegate{}, defaultWidth, listHeight)
124 l.Title = "pathos - CLI for editing a PATH env variable"
125
126 l.SetShowHelp(true)
127 l.SetShowStatusBar(true)
128 l.SetFilteringEnabled(false)
129 l.Styles.Title = titleStyle
130
131 l.AdditionalFullHelpKeys = additionalKeys
132 l.AdditionalShortHelpKeys = additionalKeys
133
134 m := model{
135 keys: keys,
136 help: help.New(),
137 list: l,
138 textInput: ti,
139 err: nil,
140 state: listView,
141 showPagination: false,
142 }
143 return m
144}
145
146func directoryExists(dir string) bool {
147 if _, err := os.Stat(dir); os.IsNotExist(err) {

Callers 1

mainFunction · 0.85

Calls 3

setupTextInputFunction · 0.85
createPathsFunction · 0.85
findDuplicatePathsFunction · 0.85

Tested by

no test coverage detected