{"action":"created","comment":{"url":"https://api.github.com/repos/gitextensions/gitextensions/pulls/comments/180060859","pull_request_review_id":110411968,"id":180060859,"diff_hunk":"@@ -173,7 +178,21 @@ public void SetHighlighting(string syntax)\n \n         public void SetHighlightingForFile(string filename)\n         {\n-            IHighlightingStrategy highlightingStrategy = HighlightingManager.Manager.FindHighlighterForFile(filename);\n+            IHighlightingStrategy highlightingStrategy;\n+\n+            if (filename.EndsWith(\"git-rebase-todo\"))\n+            {\n+                highlightingStrategy = new RebaseTodoHighlightingStrategy(_moduleProvider());\n+            }\n+            else if (filename.EndsWith(\"COMMIT_EDITMSG\"))","path":"GitUI/Editor/FileViewerInternal.cs","position":47,"original_position":47,"commit_id":"20f5fa5d5830a62b95f5370c1a8b8638a94114e6","original_commit_id":"20f5fa5d5830a62b95f5370c1a8b8638a94114e6","user":{"login":"drewnoakes","id":350947,"avatar_url":"https://avatars2.githubusercontent.com/u/350947?v=4","gravatar_id":"","url":"https://api.github.com/users/drewnoakes","html_url":"https://github.com/drewnoakes","followers_url":"https://api.github.com/users/drewnoakes/followers","following_url":"https://api.github.com/users/drewnoakes/following{/other_user}","gists_url":"https://api.github.com/users/drewnoakes/gists{/gist_id}","starred_url":"https://api.github.com/users/drewnoakes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewnoakes/subscriptions","organizations_url":"https://api.github.com/users/drewnoakes/orgs","repos_url":"https://api.github.com/users/drewnoakes/repos","events_url":"https://api.github.com/users/drewnoakes/events{/privacy}","received_events_url":"https://api.github.com/users/drewnoakes/received_events","type":"User","site_admin":false},"body":"We used to call `HighlightingManager.Manager.FindHighlighterForFile(filename);` which found a highligher based on the file's extension. However for these files, it's the file name itself that determines the syntax.\r\n\r\n```\r\n# for interactive rebase scripts\r\nC:/.../.git/rebase-merge/git-rebase-todo\r\n\r\n# for commit and squash commit message editing\r\nC:/.../.git/COMMIT_EDITMSG\r\n```","created_at":"2018-04-09T11:11:55Z","updated_at":"2018-04-09T11:15:37Z","html_url":"https://github.com/gitextensions/gitextensions/pull/4809#discussion_r180060859","pull_request_url":"https://api.github.com/repos/gitextensions/gitextensions/pulls/4809","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/gitextensions/gitextensions/pulls/comments/180060859"},"html":{"href":"https://github.com/gitextensions/gitextensions/pull/4809#discussion_r180060859"},"pull_request":{"href":"https://api.github.com/repos/gitextensions/gitextensions/pulls/4809"}}},"pull_request":{"url":"https://api.github.com/repos/gitextensions/gitextensions/pulls/4809","id":180188141,"html_url":"https://github.com/gitextensions/gitextensions/pull/4809","diff_url":"https://github.com/gitextensions/gitextensions/pull/4809.diff","patch_url":"https://github.com/gitextensions/gitextensions/pull/4809.patch","issue_url":"https://api.github.com/repos/gitextensions/gitextensions/issues/4809","number":4809,"state":"open","locked":false,"title":"Editor syntax highlighting for commit and interactive rebase","user":{"login":"drewnoakes","id":350947,"avatar_url":"https://avatars2.githubusercontent.com/u/350947?v=4","gravatar_id":"","url":"https://api.github.com/users/drewnoakes","html_url":"https://github.com/drewnoakes","followers_url":"https://api.github.com/users/drewnoakes/followers","following_url":"https://api.github.com/users/drewnoakes/following{/other_user}","gists_url":"https://api.github.com/users/drewnoakes/gists{/gist_id}","starred_url":"https://api.github.com/users/drewnoakes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewnoakes/subscriptions","organizations_url":"https://api.github.com/users/drewnoakes/orgs","repos_url":"https://api.github.com/users/drewnoakes/repos","events_url":"https://api.github.com/users/drewnoakes/events{/privacy}","received_events_url":"https://api.github.com/users/drewnoakes/received_events","type":"User","site_admin":false},"body":"Closes #3516\r\n\r\nChanges proposed in this pull request:\r\n- Add editor syntax highlighting for commit messages\r\n  - Summary line bold\r\n  - Summary line beyond 50 characters is flagged\r\n  - Non-blank line after summary is flagged\r\n  - Description lines beyond 72 characters are flagged\r\n  - Comments are highlighted\r\n- Add editor syntax highlighting for (interactive) rebase todo\r\n  - Commands are bold, and coloured\r\n  - Comments are highlighted\r\n\r\nWhat did I do to test the code and ensure quality:\r\n- Lots of manual testing\r\n- Review feedback on @azarkevich's work on #3516 and address or avoid many concerns\r\n\r\nSpecific differences to #3516:\r\n- Add support for commit messages\r\n- Add support for `core.commentChar` setting\r\n- Avoid need to modify argument processing (the file name indicates the highlight type needed)\r\n- Avoid scanning types for implementations of `IHighlightingStrategy`\r\n\r\nHas been tested on (remove any that don't apply):\r\n - GIT 2.16\r\n - Windows 10\r\n\r\n---\r\n\r\n## Screenshots\r\n\r\nNote the use of a custom comment character in the _after_ shots. This works with any reasonable character via:\r\n\r\n```\r\ngit config core.commentChar \"%\"\r\n```\r\n\r\n### Rebase\r\n\r\n*Before*\r\n\r\n![image](https://user-images.githubusercontent.com/350947/38474073-6ca1c62e-3b91-11e8-8790-00d3b3186207.png)\r\n\r\n*After*\r\n\r\n![image](https://user-images.githubusercontent.com/350947/38473985-09ace0fe-3b90-11e8-9bd7-f9019de21b45.png)\r\n\r\n\r\n### Commit\r\n\r\n*Before*\r\n\r\n![image](https://user-images.githubusercontent.com/350947/38474055-34af525e-3b91-11e8-9bb7-a3472c62b1ee.png)\r\n\r\n*After*\r\n\r\n![image](https://user-images.githubusercontent.com/350947/38474022-c9bac014-3b90-11e8-8c87-9c61b1ed47c5.png)\r\n\r\n---\r\n\r\nTo test this I found it handy to configure the locally compiled editor for use within the GE repo:\r\n\r\n```\r\ngit config core.editor \"\\\"C:\\\\somepath\\\\gitextensions\\\\GitExtensions\\\\bin\\\\Debug\\\\GitExtensions.exe\\\" fileeditor\"\r\n```\r\n\r\n","created_at":"2018-04-09T00:01:51Z","updated_at":"2018-04-09T11:15:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"13b99fc3346749baf0df781911af601dd1a7a9c9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":4294763,"url":"https://api.github.com/repos/gitextensions/gitextensions/labels/UX","name":"UX","color":"444444","default":false},{"id":125936360,"url":"https://api.github.com/repos/gitextensions/gitextensions/labels/needs%20review","name":"needs review","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/gitextensions/gitextensions/pulls/4809/commits","review_comments_url":"https://api.github.com/repos/gitextensions/gitextensions/pulls/4809/comments","review_comment_url":"https://api.github.com/repos/gitextensions/gitextensions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gitextensions/gitextensions/issues/4809/comments","statuses_url":"https://api.github.com/repos/gitextensions/gitextensions/statuses/20f5fa5d5830a62b95f5370c1a8b8638a94114e6","head":{"label":"drewnoakes:editor-highlighting","ref":"editor-highlighting","sha":"20f5fa5d5830a62b95f5370c1a8b8638a94114e6","user":{"login":"drewnoakes","id":350947,"avatar_url":"https://avatars2.githubusercontent.com/u/350947?v=4","gravatar_id":"","url":"https://api.github.com/users/drewnoakes","html_url":"https://github.com/drewnoakes","followers_url":"https://api.github.com/users/drewnoakes/followers","following_url":"https://api.github.com/users/drewnoakes/following{/other_user}","gists_url":"https://api.github.com/users/drewnoakes/gists{/gist_id}","starred_url":"https://api.github.com/users/drewnoakes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewnoakes/subscriptions","organizations_url":"https://api.github.com/users/drewnoakes/orgs","repos_url":"https://api.github.com/users/drewnoakes/repos","events_url":"https://api.github.com/users/drewnoakes/events{/privacy}","received_events_url":"https://api.github.com/users/drewnoakes/received_events","type":"User","site_admin":false},"repo":{"id":121311835,"name":"gitextensions","full_name":"drewnoakes/gitextensions","owner":{"login":"drewnoakes","id":350947,"avatar_url":"https://avatars2.githubusercontent.com/u/350947?v=4","gravatar_id":"","url":"https://api.github.com/users/drewnoakes","html_url":"https://github.com/drewnoakes","followers_url":"https://api.github.com/users/drewnoakes/followers","following_url":"https://api.github.com/users/drewnoakes/following{/other_user}","gists_url":"https://api.github.com/users/drewnoakes/gists{/gist_id}","starred_url":"https://api.github.com/users/drewnoakes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drewnoakes/subscriptions","organizations_url":"https://api.github.com/users/drewnoakes/orgs","repos_url":"https://api.github.com/users/drewnoakes/repos","events_url":"https://api.github.com/users/drewnoakes/events{/privacy}","received_events_url":"https://api.github.com/users/drewnoakes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/drewnoakes/gitextensions","description":"Git Extensions is a standalone UI tool for managing git repositories. It also integrates with Windows Explorer and Microsoft Visual Studio (2010/2012/2013/2015/2017).","fork":true,"url":"https://api.github.com/repos/drewnoakes/gitextensions","forks_url":"https://api.github.com/repos/drewnoakes/gitextensions/forks","keys_url":"https://api.github.com/repos/drewnoakes/gitextensions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/drewnoakes/gitextensions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/drewnoakes/gitextensions/teams","hooks_url":"https://api.github.com/repos/drewnoakes/gitextensions/hooks","issue_events_url":"https://api.github.com/repos/drewnoakes/gitextensions/issues/events{/number}","events_url":"https://api.github.com/repos/drewnoakes/gitextensions/events","assignees_url":"https://api.github.com/repos/drewnoakes/gitextensions/assignees{/user}","branches_url":"https://api.github.com/repos/drewnoakes/gitextensions/branches{/branch}","tags_url":"https://api.github.com/repos/drewnoakes/gitextensions/tags","blobs_url":"https://api.github.com/repos/drewnoakes/gitextensions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/drewnoakes/gitextensions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/drewnoakes/gitextensions/git/refs{/sha}","trees_url":"https://api.github.com/repos/drewnoakes/gitextensions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/drewnoakes/gitextensions/statuses/{sha}","languages_url":"https://api.github.com/repos/drewnoakes/gitextensions/languages","stargazers_url":"https://api.github.com/repos/drewnoakes/gitextensions/stargazers","contributors_url":"https://api.github.com/repos/drewnoakes/gitextensions/contributors","subscribers_url":"https://api.github.com/repos/drewnoakes/gitextensions/subscribers","subscription_url":"https://api.github.com/repos/drewnoakes/gitextensions/subscription","commits_url":"https://api.github.com/repos/drewnoakes/gitextensions/commits{/sha}","git_commits_url":"https://api.github.com/repos/drewnoakes/gitextensions/git/commits{/sha}","comments_url":"https://api.github.com/repos/drewnoakes/gitextensions/comments{/number}","issue_comment_url":"https://api.github.com/repos/drewnoakes/gitextensions/issues/comments{/number}","contents_url":"https://api.github.com/repos/drewnoakes/gitextensions/contents/{+path}","compare_url":"https://api.github.com/repos/drewnoakes/gitextensions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/drewnoakes/gitextensions/merges","archive_url":"https://api.github.com/repos/drewnoakes/gitextensions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/drewnoakes/gitextensions/downloads","issues_url":"https://api.github.com/repos/drewnoakes/gitextensions/issues{/number}","pulls_url":"https://api.github.com/repos/drewnoakes/gitextensions/pulls{/number}","milestones_url":"https://api.github.com/repos/drewnoakes/gitextensions/milestones{/number}","notifications_url":"https://api.github.com/repos/drewnoakes/gitextensions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/drewnoakes/gitextensions/labels{/name}","releases_url":"https://api.github.com/repos/drewnoakes/gitextensions/releases{/id}","deployments_url":"https://api.github.com/repos/drewnoakes/gitextensions/deployments","created_at":"2018-02-12T22:42:24Z","updated_at":"2018-04-09T00:47:43Z","pushed_at":"2018-04-09T10:47:03Z","git_url":"git://github.com/drewnoakes/gitextensions.git","ssh_url":"git@github.com:drewnoakes/gitextensions.git","clone_url":"https://github.com/drewnoakes/gitextensions.git","svn_url":"https://github.com/drewnoakes/gitextensions","homepage":"http://gitextensions.github.io/","size":73769,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"gitextensions:master","ref":"master","sha":"f21256a47792da1a1c540e1ab8d7e289d3e5a1f9","user":{"login":"gitextensions","id":1700077,"avatar_url":"https://avatars2.githubusercontent.com/u/1700077?v=4","gravatar_id":"","url":"https://api.github.com/users/gitextensions","html_url":"https://github.com/gitextensions","followers_url":"https://api.github.com/users/gitextensions/followers","following_url":"https://api.github.com/users/gitextensions/following{/other_user}","gists_url":"https://api.github.com/users/gitextensions/gists{/gist_id}","starred_url":"https://api.github.com/users/gitextensions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitextensions/subscriptions","organizations_url":"https://api.github.com/users/gitextensions/orgs","repos_url":"https://api.github.com/users/gitextensions/repos","events_url":"https://api.github.com/users/gitextensions/events{/privacy}","received_events_url":"https://api.github.com/users/gitextensions/received_events","type":"Organization","site_admin":false},"repo":{"id":85953,"name":"gitextensions","full_name":"gitextensions/gitextensions","owner":{"login":"gitextensions","id":1700077,"avatar_url":"https://avatars2.githubusercontent.com/u/1700077?v=4","gravatar_id":"","url":"https://api.github.com/users/gitextensions","html_url":"https://github.com/gitextensions","followers_url":"https://api.github.com/users/gitextensions/followers","following_url":"https://api.github.com/users/gitextensions/following{/other_user}","gists_url":"https://api.github.com/users/gitextensions/gists{/gist_id}","starred_url":"https://api.github.com/users/gitextensions/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gitextensions/subscriptions","organizations_url":"https://api.github.com/users/gitextensions/orgs","repos_url":"https://api.github.com/users/gitextensions/repos","events_url":"https://api.github.com/users/gitextensions/events{/privacy}","received_events_url":"https://api.github.com/users/gitextensions/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/gitextensions/gitextensions","description":"Git Extensions is a standalone UI tool for managing git repositories. It also integrates with Windows Explorer and Microsoft Visual Studio (2010/2012/2013/2015/2017).","fork":false,"url":"https://api.github.com/repos/gitextensions/gitextensions","forks_url":"https://api.github.com/repos/gitextensions/gitextensions/forks","keys_url":"https://api.github.com/repos/gitextensions/gitextensions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gitextensions/gitextensions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gitextensions/gitextensions/teams","hooks_url":"https://api.github.com/repos/gitextensions/gitextensions/hooks","issue_events_url":"https://api.github.com/repos/gitextensions/gitextensions/issues/events{/number}","events_url":"https://api.github.com/repos/gitextensions/gitextensions/events","assignees_url":"https://api.github.com/repos/gitextensions/gitextensions/assignees{/user}","branches_url":"https://api.github.com/repos/gitextensions/gitextensions/branches{/branch}","tags_url":"https://api.github.com/repos/gitextensions/gitextensions/tags","blobs_url":"https://api.github.com/repos/gitextensions/gitextensions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gitextensions/gitextensions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gitextensions/gitextensions/git/refs{/sha}","trees_url":"https://api.github.com/repos/gitextensions/gitextensions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gitextensions/gitextensions/statuses/{sha}","languages_url":"https://api.github.com/repos/gitextensions/gitextensions/languages","stargazers_url":"https://api.github.com/repos/gitextensions/gitextensions/stargazers","contributors_url":"https://api.github.com/repos/gitextensions/gitextensions/contributors","subscribers_url":"https://api.github.com/repos/gitextensions/gitextensions/subscribers","subscription_url":"https://api.github.com/repos/gitextensions/gitextensions/subscription","commits_url":"https://api.github.com/repos/gitextensions/gitextensions/commits{/sha}","git_commits_url":"https://api.github.com/repos/gitextensions/gitextensions/git/commits{/sha}","comments_url":"https://api.github.com/repos/gitextensions/gitextensions/comments{/number}","issue_comment_url":"https://api.github.com/repos/gitextensions/gitextensions/issues/comments{/number}","contents_url":"https://api.github.com/repos/gitextensions/gitextensions/contents/{+path}","compare_url":"https://api.github.com/repos/gitextensions/gitextensions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gitextensions/gitextensions/merges","archive_url":"https://api.github.com/repos/gitextensions/gitextensions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gitextensions/gitextensions/downloads","issues_url":"https://api.github.com/repos/gitextensions/gitextensions/issues{/number}","pulls_url":"https://api.github.com/repos/gitextensions/gitextensions/pulls{/number}","milestones_url":"https://api.github.com/repos/gitextensions/gitextensions/milestones{/number}","notifications_url":"https://api.github.com/repos/gitextensions/gitextensions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gitextensions/gitextensions/labels{/name}","releases_url":"https://api.github.com/repos/gitextensions/gitextensions/releases{/id}","deployments_url":"https://api.github.com/repos/gitextensions/gitextensions/deployments","created_at":"2008-12-06T09:18:59Z","updated_at":"2018-04-09T10:27:28Z","pushed_at":"2018-04-09T10:47:05Z","git_url":"git://github.com/gitextensions/gitextensions.git","ssh_url":"git@github.com:gitextensions/gitextensions.git","clone_url":"https://github.com/gitextensions/gitextensions.git","svn_url":"https://github.com/gitextensions/gitextensions","homepage":"http://gitextensions.github.io/","size":73309,"stargazers_count":2722,"watchers_count":2722,"language":"C#","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":984,"mirror_url":null,"archived":false,"open_issues_count":684,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":984,"open_issues":684,"watchers":2722,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gitextensions/gitextensions/pulls/4809"},"html":{"href":"https://github.com/gitextensions/gitextensions/pull/4809"},"issue":{"href":"https://api.github.com/repos/gitextensions/gitextensions/issues/4809"},"comments":{"href":"https://api.github.com/repos/gitextensions/gitextensions/issues/4809/comments"},"review_comments":{"href":"https://api.github.com/repos/gitextensions/gitextensions/pulls/4809/comments"},"review_comment":{"href":"https://api.github.com/repos/gitextensions/gitextensions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gitextensions/gitextensions/pulls/4809/commits"},"statuses":{"href":"https://api.github.com/repos/gitextensions/gitextensions/statuses/20f5fa5d5830a62b95f5370c1a8b8638a94114e6"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"drewnoakes"}}