Closed simurgh9 closed 2 years ago
The only thing I see is that you can simplify getting the name as (treemacs--filename (treemacs--parent-dir default-directory))
. And for extra safety you can add a check that point is at a valid file node: (-some-> (treemacs-current-button) (treemacs-button-get :key) (file-exists-p))
. Other than that it looks good to me.
I wanted a command that will open the nearest parent directory in a new workspace. I wrote,
It works. But, I was wondering if this is indeed the best approach or needed at all. Maybe there is a built-in function I am not aware of.