Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Twf crashes, if the passed path is not a child of the current working directory. #23

@jmehne

Description

@jmehne

Hello,

thanks for this nice tool. I'm currently trying to use it to replace NERDtree etc. in vim. Unfortunately, twf crashes, when the path passed to it is not a child of the current working directory. This also happens with plain twf without vim:

  • twf build from master on Arch Linux.
  • Reproduction steps without vim:
cd /tmp
twf /home
  • Error:
panic: Path not found: /home

goroutine 1 [running]:
main.main()
	github.com/wvanlint/twf/cmd/twf/main.go:69 +0x7d0

I find this especially important for the vim use case:

cd /tmp
vim /home/foo
# in vim, trying to navigate the directory of the opened buffer
! twf /tmp
# Results in an error:
panic: Path not found: /home

goroutine 1 [running]:
main.main()
	github.com/wvanlint/twf/cmd/twf/main.go:69 +0x7d0

shell returned 2

Press ENTER or type command to continue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions