Skip to content

Commit

Permalink
more update refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mistakenelf committed Oct 16, 2021
1 parent 0b13439 commit 9aaf7f2
Show file tree
Hide file tree
Showing 2 changed files with 144 additions and 163 deletions.
8 changes: 7 additions & 1 deletion internal/ui/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ func (m Model) updateDirectoryListingCmd(name string) tea.Cmd {
// previewDirectoryListingCmd updates the directory listing based on the name of the directory provided.
func (m Model) previewDirectoryListingCmd(name string) tea.Cmd {
return func() tea.Msg {
files, err := dirfs.GetDirectoryListing(name, m.dirTree.ShowHidden)
currentDir, err := dirfs.GetWorkingDirectory()
if err != nil {
return errorMsg(err.Error())
}

fileName := fmt.Sprintf("%s/%s", currentDir, name)
files, err := dirfs.GetDirectoryListing(fileName, m.dirTree.ShowHidden)
if err != nil {
return errorMsg(err.Error())
}
Expand Down
Loading

0 comments on commit 9aaf7f2

Please sign in to comment.