[Github-comments] [geany/geany] Rearrange get_doc_parent(); Place everything about creating the folder string to get_folder_name() (#1199)
konsolebox
notifications at xxxxx
Tue Aug 30 12:57:54 UTC 2016
The ways on how a "folder name string" should be created and compared is divided in many parts of `get_doc_parent()` and the functions it call. One is from `get_folder_name()` itself, another is from `find_tree_iter_dir()` (`if (utils_str_equal(dir, ".")) dir = GEANY_STRING_UNTITLED;`), and another in the assignment of the item to `store_openfiles` (`DOCUMENTS_SHORTNAME, doc->file_name ? dirname : GEANY_STRING_UNTITLED`).
The ambiguity causes issues like having multiple parents in the Documents list that has the name `.` when the filename has a basename but not a directory name. This can be done by creating multiple new files with a template.
This patch is basically an overhaul to fix the ambiguity, and the issue is fixed along with it. If `get_folder_name()` is shared and used somewhere else besides `sidebar.c`, it would no longer require a wrapper just to make the returned string consistent.
You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/1199
-- Commit Summary --
* Fix new files created with template not being placed in 'untitled' folder
* Place everything about creating document folder string in get_doc_folder()
-- File Changes --
M src/sidebar.c (128)
-- Patch Links --
https://github.com/geany/geany/pull/1199.patch
https://github.com/geany/geany/pull/1199.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/1199
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20160830/067ca7fa/attachment.html>
More information about the Github-comments
mailing list