We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c98050b commit e8aff06Copy full SHA for e8aff06
ui/ui.go
@@ -246,8 +246,17 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
246
return m, tea.Quit
247
248
case "left", "h", "delete":
249
- yes, _ := utils.StdinIsPipe()
250
- if m.state == stateShowDocument && !yes {
+ isPipe, _ := utils.StdinIsPipe()
+ path := m.common.cfg.Path
251
+ if path == "" {
252
+ path = "."
253
+ }
254
+ isDir := false
255
+ info, err := os.Stat(path)
256
+ if err == nil && info.IsDir() {
257
+ isDir = true
258
259
+ if m.state == stateShowDocument && !isPipe && isDir {
260
cmds = append(cmds, m.unloadDocument()...)
261
return m, tea.Batch(cmds...)
262
}
0 commit comments