{"action":"created","comment":{"url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/pulls/comments/33004003","id":33004003,"diff_hunk":"@@ -63,24 +69,159 @@\n #define PM_MOVEUPENTRY             TEXT(\"Move Up\\tCtrl+Up\")\r\n #define PM_MOVEDOWNENTRY           TEXT(\"Move Down\\tCtrl+Down\")\r\n \r\n-enum NodeType {\r\n-\tnodeType_root = 0, nodeType_project = 1, nodeType_folder = 2, nodeType_file = 3\r\n-};\r\n-\r\n class TiXmlNode;\r\n \r\n-class ProjectPanel : public DockingDlgInterface {\r\n+\r\n+\r\n+\r\n+class ProjectPanel : public DockingDlgInterface, public TreeViewListener {\r\n+\r\n+\tfriend int CALLBACK compareFunc(LPARAM, LPARAM, LPARAM);\r\n+\r\n+\tenum NodeType { nodeType_dummy = -1, nodeType_root = 0, nodeType_project = 1, nodeType_folder = 2, nodeType_file = 3, nodeType_baseDir = 4, nodeType_dir = 5, nodeType_dirFile = 6, };\r\n+\r\n+\t// private class ProjectPanelData is stored in the LPARAM of the tree nodes.\r\n+\t// The data it contains depends on the node type.\r\n+\tclass ProjectPanelData final : public TreeViewData {\r\n+\tpublic:\r\n+\t\tgeneric_string _name;\r\n+\t\tgeneric_string _filePath;\r\n+\t\tgeneric_string _userLabel;\r\n+\t\tstd::vector<generic_string> _filters;\r\n+\t\tNodeType _nodeType;\r\n+\t\tDirectoryWatcher& _directoryWatcher;\r\n+\t\tHTREEITEM _hItem;\r\n+\t\tbool _watch;\r\n+\r\n+\t\tProjectPanelData(DirectoryWatcher& directoryWatcher, const TCHAR* name, const TCHAR* filePath, NodeType nodeType, const std::vector<generic_string> filters = std::vector<generic_string>()) \r","path":"PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.h","position":55,"original_position":55,"commit_id":"9e771b31d813d45c98554fb5ba8bd9f5c6a9baa4","original_commit_id":"9e771b31d813d45c98554fb5ba8bd9f5c6a9baa4","user":{"login":"ariccio","id":2142308,"avatar_url":"https://avatars.githubusercontent.com/u/2142308?v=3","gravatar_id":"","url":"https://api.github.com/users/ariccio","html_url":"https://github.com/ariccio","followers_url":"https://api.github.com/users/ariccio/followers","following_url":"https://api.github.com/users/ariccio/following{/other_user}","gists_url":"https://api.github.com/users/ariccio/gists{/gist_id}","starred_url":"https://api.github.com/users/ariccio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ariccio/subscriptions","organizations_url":"https://api.github.com/users/ariccio/orgs","repos_url":"https://api.github.com/users/ariccio/repos","events_url":"https://api.github.com/users/ariccio/events{/privacy}","received_events_url":"https://api.github.com/users/ariccio/received_events","type":"User","site_admin":false},"body":"The `const TCHAR*` arguments should be one of:\r\n\r\n- `_In_z_ const TCHAR*`\r\n- `PCTSTR`","created_at":"2015-06-23T02:10:09Z","updated_at":"2015-06-23T02:10:09Z","html_url":"https://github.com/notepad-plus-plus/notepad-plus-plus/pull/214#discussion_r33004003","pull_request_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/pulls/214","_links":{"self":{"href":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/pulls/comments/33004003"},"html":{"href":"https://github.com/notepad-plus-plus/notepad-plus-plus/pull/214#discussion_r33004003"},"pull_request":{"href":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/pulls/214"}}},"pull_request":{"url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/pulls/214","id":37643792,"html_url":"https://github.com/notepad-plus-plus/notepad-plus-plus/pull/214","diff_url":"https://github.com/notepad-plus-plus/notepad-plus-plus/pull/214.diff","patch_url":"https://github.com/notepad-plus-plus/notepad-plus-plus/pull/214.patch","issue_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/issues/214","number":214,"state":"open","locked":false,"title":"Added monitored directories to project panel (Change request #2024)","user":{"login":"Arkarit","id":12444486,"avatar_url":"https://avatars.githubusercontent.com/u/12444486?v=3","gravatar_id":"","url":"https://api.github.com/users/Arkarit","html_url":"https://github.com/Arkarit","followers_url":"https://api.github.com/users/Arkarit/followers","following_url":"https://api.github.com/users/Arkarit/following{/other_user}","gists_url":"https://api.github.com/users/Arkarit/gists{/gist_id}","starred_url":"https://api.github.com/users/Arkarit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arkarit/subscriptions","organizations_url":"https://api.github.com/users/Arkarit/orgs","repos_url":"https://api.github.com/users/Arkarit/repos","events_url":"https://api.github.com/users/Arkarit/events{/privacy}","received_events_url":"https://api.github.com/users/Arkarit/received_events","type":"User","site_admin":false},"body":"Monitored directories can be added to a project.\r\nEach monitored directory can have multiple search patterns. These search patterns are displayed in the directory and in the info tip. Clearing the search pattern filters for all files. Sub directories, which contain no data matching the pattern, are hidden.\r\nDirectories can also be renamed manually.\r\n\r\n\r\nImplementation details:\r\nThe monitoring is done by polling every second.\r\n\r\nI don't really like polling, but I tried two other obvious attempts, both of which had severe drawbacks:\r\n\r\nFindFirstChangeNotification/FindNextChangeNotification: Did not work very good, because a max of ~60 directories per thread can be handled (64 objects limit of WaitForMultipleObjects). Additionally, it is not very useful when used for full sub trees, because it does not offer details about WHAT was changed.\r\n\r\nGetQueuedCompletionStatus/ReadDirectoryChangesW: Worked absolutely perfect in terms of being notified, BUT locked all open directories against deletion, which is definitely not what we want: The feature is mainly thought for directories, which are externally changed, e.g. a Perforce directory of LUA files, which change on every get latest version. It would be completely counterproductive if Perforce would be hindered from deleting directories, because Notepad++ watches it.\r\n\r\nThe polling itself is quick, because the last write time is checked first.\r\n\r\nEvery 10 seconds, the visibility of the sub directories is checked.\r\nSince this is a recursive operation (a sub-directory may not be hidden, if a sub-sub-sub-directory contains data), this is a far more time consuming operation. If you add directories with an extreme amount of sub-directories (e.g. C:\\Windows\\winsxs, it has ~18.000 sub directories on my machine!), a remarkably time is spent by checking these. Nevertheless, monitoring winsxs is not what the project panel is thought for, and for moderately big directories, it works pretty good.\r\n\r\nAdditionally, there is still some optimization potential for opening directories, which is slow currently for really large directories. Currently, if a directory changes, the directory is read and compared in the watcher thread, then a message is sent, and then its read and compared again in the project panel. It would be better, if the directory contents would be directly sent.\r\n\r\nProbably, the monitoring feature and the sub directory visibility feature could be switched by user options. This is prepared, but not tested.\r\n\r\nFeedback appreciated.","created_at":"2015-06-14T16:02:23Z","updated_at":"2015-06-23T02:10:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2ab4611037bd3f72aaf7fc9b2e59cc6d148c8643","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/pulls/214/commits","review_comments_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/pulls/214/comments","review_comment_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/pulls/comments{/number}","comments_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/issues/214/comments","statuses_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/statuses/9e771b31d813d45c98554fb5ba8bd9f5c6a9baa4","head":{"label":"Arkarit:monitoredProjectDirectories","ref":"monitoredProjectDirectories","sha":"9e771b31d813d45c98554fb5ba8bd9f5c6a9baa4","user":{"login":"Arkarit","id":12444486,"avatar_url":"https://avatars.githubusercontent.com/u/12444486?v=3","gravatar_id":"","url":"https://api.github.com/users/Arkarit","html_url":"https://github.com/Arkarit","followers_url":"https://api.github.com/users/Arkarit/followers","following_url":"https://api.github.com/users/Arkarit/following{/other_user}","gists_url":"https://api.github.com/users/Arkarit/gists{/gist_id}","starred_url":"https://api.github.com/users/Arkarit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arkarit/subscriptions","organizations_url":"https://api.github.com/users/Arkarit/orgs","repos_url":"https://api.github.com/users/Arkarit/repos","events_url":"https://api.github.com/users/Arkarit/events{/privacy}","received_events_url":"https://api.github.com/users/Arkarit/received_events","type":"User","site_admin":false},"repo":{"id":35608524,"name":"notepad-plus-plus","full_name":"Arkarit/notepad-plus-plus","owner":{"login":"Arkarit","id":12444486,"avatar_url":"https://avatars.githubusercontent.com/u/12444486?v=3","gravatar_id":"","url":"https://api.github.com/users/Arkarit","html_url":"https://github.com/Arkarit","followers_url":"https://api.github.com/users/Arkarit/followers","following_url":"https://api.github.com/users/Arkarit/following{/other_user}","gists_url":"https://api.github.com/users/Arkarit/gists{/gist_id}","starred_url":"https://api.github.com/users/Arkarit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arkarit/subscriptions","organizations_url":"https://api.github.com/users/Arkarit/orgs","repos_url":"https://api.github.com/users/Arkarit/repos","events_url":"https://api.github.com/users/Arkarit/events{/privacy}","received_events_url":"https://api.github.com/users/Arkarit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Arkarit/notepad-plus-plus","description":"Notepad++ work repository (non-official). For official repository see donho/notepad-plus-plus","fork":true,"url":"https://api.github.com/repos/Arkarit/notepad-plus-plus","forks_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/forks","keys_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/teams","hooks_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/hooks","issue_events_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/issues/events{/number}","events_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/events","assignees_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/assignees{/user}","branches_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/branches{/branch}","tags_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/tags","blobs_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/git/refs{/sha}","trees_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/statuses/{sha}","languages_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/languages","stargazers_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/stargazers","contributors_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/contributors","subscribers_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/subscribers","subscription_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/subscription","commits_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/commits{/sha}","git_commits_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/git/commits{/sha}","comments_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/comments{/number}","issue_comment_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/issues/comments{/number}","contents_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/contents/{+path}","compare_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/merges","archive_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/downloads","issues_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/issues{/number}","pulls_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/pulls{/number}","milestones_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/milestones{/number}","notifications_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/labels{/name}","releases_url":"https://api.github.com/repos/Arkarit/notepad-plus-plus/releases{/id}","created_at":"2015-05-14T11:53:02Z","updated_at":"2015-05-23T08:04:46Z","pushed_at":"2015-06-21T00:08:06Z","git_url":"git://github.com/Arkarit/notepad-plus-plus.git","ssh_url":"git@github.com:Arkarit/notepad-plus-plus.git","clone_url":"https://github.com/Arkarit/notepad-plus-plus.git","svn_url":"https://github.com/Arkarit/notepad-plus-plus","homepage":"","size":142822,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"notepad-plus-plus:master","ref":"master","sha":"0d768dd289e504f2f1dddbcc97f8073213d29c05","user":{"login":"notepad-plus-plus","id":12589084,"avatar_url":"https://avatars.githubusercontent.com/u/12589084?v=3","gravatar_id":"","url":"https://api.github.com/users/notepad-plus-plus","html_url":"https://github.com/notepad-plus-plus","followers_url":"https://api.github.com/users/notepad-plus-plus/followers","following_url":"https://api.github.com/users/notepad-plus-plus/following{/other_user}","gists_url":"https://api.github.com/users/notepad-plus-plus/gists{/gist_id}","starred_url":"https://api.github.com/users/notepad-plus-plus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notepad-plus-plus/subscriptions","organizations_url":"https://api.github.com/users/notepad-plus-plus/orgs","repos_url":"https://api.github.com/users/notepad-plus-plus/repos","events_url":"https://api.github.com/users/notepad-plus-plus/events{/privacy}","received_events_url":"https://api.github.com/users/notepad-plus-plus/received_events","type":"Organization","site_admin":false},"repo":{"id":33014811,"name":"notepad-plus-plus","full_name":"notepad-plus-plus/notepad-plus-plus","owner":{"login":"notepad-plus-plus","id":12589084,"avatar_url":"https://avatars.githubusercontent.com/u/12589084?v=3","gravatar_id":"","url":"https://api.github.com/users/notepad-plus-plus","html_url":"https://github.com/notepad-plus-plus","followers_url":"https://api.github.com/users/notepad-plus-plus/followers","following_url":"https://api.github.com/users/notepad-plus-plus/following{/other_user}","gists_url":"https://api.github.com/users/notepad-plus-plus/gists{/gist_id}","starred_url":"https://api.github.com/users/notepad-plus-plus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/notepad-plus-plus/subscriptions","organizations_url":"https://api.github.com/users/notepad-plus-plus/orgs","repos_url":"https://api.github.com/users/notepad-plus-plus/repos","events_url":"https://api.github.com/users/notepad-plus-plus/events{/privacy}","received_events_url":"https://api.github.com/users/notepad-plus-plus/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/notepad-plus-plus/notepad-plus-plus","description":"Notepad++ official repository","fork":false,"url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus","forks_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/forks","keys_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/keys{/key_id}","collaborators_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/teams","hooks_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/hooks","issue_events_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/issues/events{/number}","events_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/events","assignees_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/assignees{/user}","branches_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/branches{/branch}","tags_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/tags","blobs_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/git/refs{/sha}","trees_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/git/trees{/sha}","statuses_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/statuses/{sha}","languages_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/languages","stargazers_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/stargazers","contributors_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/contributors","subscribers_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/subscribers","subscription_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/subscription","commits_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/commits{/sha}","git_commits_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/git/commits{/sha}","comments_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/comments{/number}","issue_comment_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/issues/comments{/number}","contents_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/contents/{+path}","compare_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/compare/{base}...{head}","merges_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/merges","archive_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/downloads","issues_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/issues{/number}","pulls_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/pulls{/number}","milestones_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/milestones{/number}","notifications_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/labels{/name}","releases_url":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/releases{/id}","created_at":"2015-03-28T00:05:08Z","updated_at":"2015-06-22T22:35:34Z","pushed_at":"2015-06-22T22:16:43Z","git_url":"git://github.com/notepad-plus-plus/notepad-plus-plus.git","ssh_url":"git@github.com:notepad-plus-plus/notepad-plus-plus.git","clone_url":"https://github.com/notepad-plus-plus/notepad-plus-plus.git","svn_url":"https://github.com/notepad-plus-plus/notepad-plus-plus","homepage":"https://notepad-plus-plus.org/","size":157675,"stargazers_count":1408,"watchers_count":1408,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":199,"mirror_url":null,"open_issues_count":158,"forks":199,"open_issues":158,"watchers":1408,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/pulls/214"},"html":{"href":"https://github.com/notepad-plus-plus/notepad-plus-plus/pull/214"},"issue":{"href":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/issues/214"},"comments":{"href":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/issues/214/comments"},"review_comments":{"href":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/pulls/214/comments"},"review_comment":{"href":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/pulls/214/commits"},"statuses":{"href":"https://api.github.com/repos/notepad-plus-plus/notepad-plus-plus/statuses/9e771b31d813d45c98554fb5ba8bd9f5c6a9baa4"}}}}