Uses the URI to get parent instead of the tree to allow for insertion at the top level. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany-plugins/pull/960
-- Commit Summary --
* Fix create when selection is in top of path
-- File Changes --
M treebrowser/src/treebrowser.c (14)
-- Patch Links --
https://github.com/geany/geany-plugins/pull/960.patch https://github.com/geany/geany-plugins/pull/960.diff
Fixed being unable to create file from empty folder item "(Empty)".
The assignment could be written shorter as: `SETPTR(uri, g_path_get_dirname(uri));` but this is rather a matter of taste.
I tested the changes and it "probably" works. I cannot test for sure as my `/` (root) is not writable for my user and this is good. This is probably also why nobody noticed earlier, I guess the root directory isn't writable for most users, maybe except on Windows and macOS.
@ChrisJAllan just for my curiosity, are you on Linux and your `/` is user writable?
Ah, I guess this was worded poorly. I meant the root folder shown in the tree browser, not `/`.
Then I don't understand how to create a new file/folder without a parent. Whenever I right-click a file/folder on the top level of the tree and choose "New Folder", it is created as expected. Could you maybe precise the steps to reproduce?
Btw, it was not necessary to create a seperate issue for this, describing the problem and steps to reproduce in the PR description is usually enough.
At the top level:
https://user-images.githubusercontent.com/9275775/148692489-1fdcff53-e884-4c...
At non-top level:
https://user-images.githubusercontent.com/9275775/148692513-b70d213a-09df-43...
Update: use `SETPTR` and rebase
Thanks for the explanation, I was finally able to reproduce the issue.
Merged #960 into master.
github-comments@lists.geany.org