{"action":"created","comment":{"url":"https://api.github.com/repos/neovim/neovim/pulls/comments/66967333","id":66967333,"diff_hunk":"@@ -0,0 +1,511 @@\n+-- Test the good behavior of the live action : substitution\n+\n+local helpers = require('test.functional.helpers')(after_each)\n+local Screen = require('test.functional.ui.screen')\n+local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert\n+local execute, request, neq = helpers.execute, helpers.request, helpers.neq\n+\n+\n+describe('Live Substitution', function()\n+    local screen\n+    local curbuf\n+\n+    local hl_colors = {\n+        NonText = Screen.colors.Blue,\n+        Question = Screen.colors.SeaGreen,\n+        String = Screen.colors.Fuchsia,\n+        Statement = Screen.colors.Brown,\n+        Special = Screen.colors.SlateBlue,\n+        Identifier = Screen.colors.DarkCyan\n+    }\n+\n+    before_each(function()\n+        clear()\n+        execute(\"syntax on\")\n+        execute(\"set livesub\")\n+        execute('set nohlsearch')\n+        screen = Screen.new(40, 40)  -- 40 lines of 40 char\n+        screen:attach()\n+        screen:set_default_attr_ignore( {{bold=true, foreground=hl_colors.NonText}} )\n+        screen:set_default_attr_ids({\n+            [1] = {foreground = hl_colors.String},\n+            [2] = {foreground = hl_colors.Statement, bold = true},\n+            [3] = {foreground = hl_colors.Special},\n+            [4] = {bold = true, foreground = hl_colors.Special},\n+            [5] = {foreground = hl_colors.Identifier},\n+            [6] = {bold = true},\n+            [7] = {underline = true, bold = true, foreground = hl_colors.Special},\n+            [8] = {foreground = hl_colors.Special, underline = true}\n+        })\n+        curbuf = request('vim_get_current_buffer')\n+    end)\n+\n+    after_each(function()\n+        screen:detach()\n+    end)\n+\n+    local function add_hl(...)\n+        return request('buffer_add_highlight', curbuf, ...)\n+    end\n+\n+    local function clear_hl(...)\n+        return request('buffer_clear_highlight', curbuf, ...)\n+    end\n+\n+    -- ----------------------------------------------------------------------\n+    -- simple tests\n+    -- ----------------------------------------------------------------------\n+\n+    it('old behavior if :set nolivesub', function()\n+        insert([[\n+      these are some lines\n+      with colorful text (are)]])\n+        feed(':set nolivesub\\n')\n+        feed(':%s/are/ARE')\n+\n+        screen:expect([[\n+      these are some lines                    |\n+      with colorful text (are)                |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      :%s/are/ARE^                             |\n+    ]])\n+\n+        feed('\\27')     -- ESC\n+        feed(':%s/are/ARE\\n')\n+\n+        screen:expect([[\n+          these ARE some lines                    |\n+          ^with colorful text (ARE)                |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          ~                                       |\n+          :%s/are/ARE                             |\n+    ]])\n+    end)\n+\n+    it('no split if :s', function()\n+        insert([[\n+      these are some lines\n+      with colorful text (are)]])\n+        feed(':s/are/ARE')\n+\n+        screen:expect([[\n+      these are some lines                    |\n+      with colorful text (ARE)                |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      ~                                       |\n+      :s/are/ARE^                              |\n+    ]])\n+    end)\n+\n+    it('split if :%s/are', function()\n+        insert([[\n+      these are some lines\n+      without colorful text (are)]])\n+        execute('set hlsearch')\n+        feed(':%s/are')\n+\n+        screen:expect([[\n+        these {UNEXPECTED background = Screen.colors.Yellow:are} some lines                    |","path":"test/functional/ui/live_substitution_spec.lua","position":214,"original_position":214,"commit_id":"5b116a5e4a89c69bf319550cd3e0bf7aef076b9c","original_commit_id":"5b116a5e4a89c69bf319550cd3e0bf7aef076b9c","user":{"login":"bfredl","id":1363104,"avatar_url":"https://avatars.githubusercontent.com/u/1363104?v=3","gravatar_id":"","url":"https://api.github.com/users/bfredl","html_url":"https://github.com/bfredl","followers_url":"https://api.github.com/users/bfredl/followers","following_url":"https://api.github.com/users/bfredl/following{/other_user}","gists_url":"https://api.github.com/users/bfredl/gists{/gist_id}","starred_url":"https://api.github.com/users/bfredl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfredl/subscriptions","organizations_url":"https://api.github.com/users/bfredl/orgs","repos_url":"https://api.github.com/users/bfredl/repos","events_url":"https://api.github.com/users/bfredl/events{/privacy}","received_events_url":"https://api.github.com/users/bfredl/received_events","type":"User","site_admin":false},"body":"`UNEXPECTED` shouldn't be in a test, and should not ever be emitted by `snapshot_util()` ( If it is please file a bug), I guess it was manually edited but it is better to just add `snapshot_util()` again before the test and replace it (and optionally append the new groups to `set_default_attr_ids()`)","created_at":"2016-06-14T13:19:11Z","updated_at":"2016-06-14T13:19:11Z","html_url":"https://github.com/neovim/neovim/pull/4915#discussion_r66967333","pull_request_url":"https://api.github.com/repos/neovim/neovim/pulls/4915","_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments/66967333"},"html":{"href":"https://github.com/neovim/neovim/pull/4915#discussion_r66967333"},"pull_request":{"href":"https://api.github.com/repos/neovim/neovim/pulls/4915"}}},"pull_request":{"url":"https://api.github.com/repos/neovim/neovim/pulls/4915","id":73619129,"html_url":"https://github.com/neovim/neovim/pull/4915","diff_url":"https://github.com/neovim/neovim/pull/4915.diff","patch_url":"https://github.com/neovim/neovim/pull/4915.patch","issue_url":"https://api.github.com/repos/neovim/neovim/issues/4915","number":4915,"state":"open","locked":false,"title":"[WIP] Livesub finishing","user":{"login":"KillTheMule","id":4117685,"avatar_url":"https://avatars.githubusercontent.com/u/4117685?v=3","gravatar_id":"","url":"https://api.github.com/users/KillTheMule","html_url":"https://github.com/KillTheMule","followers_url":"https://api.github.com/users/KillTheMule/followers","following_url":"https://api.github.com/users/KillTheMule/following{/other_user}","gists_url":"https://api.github.com/users/KillTheMule/gists{/gist_id}","starred_url":"https://api.github.com/users/KillTheMule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KillTheMule/subscriptions","organizations_url":"https://api.github.com/users/KillTheMule/orgs","repos_url":"https://api.github.com/users/KillTheMule/repos","events_url":"https://api.github.com/users/KillTheMule/events{/privacy}","received_events_url":"https://api.github.com/users/KillTheMule/received_events","type":"User","site_admin":false},"body":"Finishing up the livesub feature. I'll first squash commits, then see if I can work out the memory leaks, and after that I'll deal with the linting.\r\n\r\nRef https://github.com/neovim/neovim/pull/4811.","created_at":"2016-06-13T18:13:39Z","updated_at":"2016-06-14T13:19:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a29b5ed930bce0762c838775774c87f4755b07d6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/neovim/neovim/pulls/4915/commits","review_comments_url":"https://api.github.com/repos/neovim/neovim/pulls/4915/comments","review_comment_url":"https://api.github.com/repos/neovim/neovim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/neovim/neovim/issues/4915/comments","statuses_url":"https://api.github.com/repos/neovim/neovim/statuses/5b116a5e4a89c69bf319550cd3e0bf7aef076b9c","head":{"label":"KillTheMule:livesub","ref":"livesub","sha":"5b116a5e4a89c69bf319550cd3e0bf7aef076b9c","user":{"login":"KillTheMule","id":4117685,"avatar_url":"https://avatars.githubusercontent.com/u/4117685?v=3","gravatar_id":"","url":"https://api.github.com/users/KillTheMule","html_url":"https://github.com/KillTheMule","followers_url":"https://api.github.com/users/KillTheMule/followers","following_url":"https://api.github.com/users/KillTheMule/following{/other_user}","gists_url":"https://api.github.com/users/KillTheMule/gists{/gist_id}","starred_url":"https://api.github.com/users/KillTheMule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KillTheMule/subscriptions","organizations_url":"https://api.github.com/users/KillTheMule/orgs","repos_url":"https://api.github.com/users/KillTheMule/repos","events_url":"https://api.github.com/users/KillTheMule/events{/privacy}","received_events_url":"https://api.github.com/users/KillTheMule/received_events","type":"User","site_admin":false},"repo":{"id":55714263,"name":"neovim","full_name":"KillTheMule/neovim","owner":{"login":"KillTheMule","id":4117685,"avatar_url":"https://avatars.githubusercontent.com/u/4117685?v=3","gravatar_id":"","url":"https://api.github.com/users/KillTheMule","html_url":"https://github.com/KillTheMule","followers_url":"https://api.github.com/users/KillTheMule/followers","following_url":"https://api.github.com/users/KillTheMule/following{/other_user}","gists_url":"https://api.github.com/users/KillTheMule/gists{/gist_id}","starred_url":"https://api.github.com/users/KillTheMule/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KillTheMule/subscriptions","organizations_url":"https://api.github.com/users/KillTheMule/orgs","repos_url":"https://api.github.com/users/KillTheMule/repos","events_url":"https://api.github.com/users/KillTheMule/events{/privacy}","received_events_url":"https://api.github.com/users/KillTheMule/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/KillTheMule/neovim","description":"Vim-fork focused on extensibility and agility. Consider helping sustain Neovim development! ","fork":true,"url":"https://api.github.com/repos/KillTheMule/neovim","forks_url":"https://api.github.com/repos/KillTheMule/neovim/forks","keys_url":"https://api.github.com/repos/KillTheMule/neovim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KillTheMule/neovim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KillTheMule/neovim/teams","hooks_url":"https://api.github.com/repos/KillTheMule/neovim/hooks","issue_events_url":"https://api.github.com/repos/KillTheMule/neovim/issues/events{/number}","events_url":"https://api.github.com/repos/KillTheMule/neovim/events","assignees_url":"https://api.github.com/repos/KillTheMule/neovim/assignees{/user}","branches_url":"https://api.github.com/repos/KillTheMule/neovim/branches{/branch}","tags_url":"https://api.github.com/repos/KillTheMule/neovim/tags","blobs_url":"https://api.github.com/repos/KillTheMule/neovim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KillTheMule/neovim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KillTheMule/neovim/git/refs{/sha}","trees_url":"https://api.github.com/repos/KillTheMule/neovim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KillTheMule/neovim/statuses/{sha}","languages_url":"https://api.github.com/repos/KillTheMule/neovim/languages","stargazers_url":"https://api.github.com/repos/KillTheMule/neovim/stargazers","contributors_url":"https://api.github.com/repos/KillTheMule/neovim/contributors","subscribers_url":"https://api.github.com/repos/KillTheMule/neovim/subscribers","subscription_url":"https://api.github.com/repos/KillTheMule/neovim/subscription","commits_url":"https://api.github.com/repos/KillTheMule/neovim/commits{/sha}","git_commits_url":"https://api.github.com/repos/KillTheMule/neovim/git/commits{/sha}","comments_url":"https://api.github.com/repos/KillTheMule/neovim/comments{/number}","issue_comment_url":"https://api.github.com/repos/KillTheMule/neovim/issues/comments{/number}","contents_url":"https://api.github.com/repos/KillTheMule/neovim/contents/{+path}","compare_url":"https://api.github.com/repos/KillTheMule/neovim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KillTheMule/neovim/merges","archive_url":"https://api.github.com/repos/KillTheMule/neovim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KillTheMule/neovim/downloads","issues_url":"https://api.github.com/repos/KillTheMule/neovim/issues{/number}","pulls_url":"https://api.github.com/repos/KillTheMule/neovim/pulls{/number}","milestones_url":"https://api.github.com/repos/KillTheMule/neovim/milestones{/number}","notifications_url":"https://api.github.com/repos/KillTheMule/neovim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KillTheMule/neovim/labels{/name}","releases_url":"https://api.github.com/repos/KillTheMule/neovim/releases{/id}","deployments_url":"https://api.github.com/repos/KillTheMule/neovim/deployments","created_at":"2016-04-07T17:28:12Z","updated_at":"2016-04-07T17:28:19Z","pushed_at":"2016-06-13T20:31:08Z","git_url":"git://github.com/KillTheMule/neovim.git","ssh_url":"git@github.com:KillTheMule/neovim.git","clone_url":"https://github.com/KillTheMule/neovim.git","svn_url":"https://github.com/KillTheMule/neovim","homepage":"https://salt.bountysource.com/teams/neovim","size":41636,"stargazers_count":0,"watchers_count":0,"language":"VimL","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":"neovim:master","ref":"master","sha":"20447ba0983a29537ae9d8df435fdf0f412c4258","user":{"login":"neovim","id":6471485,"avatar_url":"https://avatars.githubusercontent.com/u/6471485?v=3","gravatar_id":"","url":"https://api.github.com/users/neovim","html_url":"https://github.com/neovim","followers_url":"https://api.github.com/users/neovim/followers","following_url":"https://api.github.com/users/neovim/following{/other_user}","gists_url":"https://api.github.com/users/neovim/gists{/gist_id}","starred_url":"https://api.github.com/users/neovim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neovim/subscriptions","organizations_url":"https://api.github.com/users/neovim/orgs","repos_url":"https://api.github.com/users/neovim/repos","events_url":"https://api.github.com/users/neovim/events{/privacy}","received_events_url":"https://api.github.com/users/neovim/received_events","type":"Organization","site_admin":false},"repo":{"id":16408992,"name":"neovim","full_name":"neovim/neovim","owner":{"login":"neovim","id":6471485,"avatar_url":"https://avatars.githubusercontent.com/u/6471485?v=3","gravatar_id":"","url":"https://api.github.com/users/neovim","html_url":"https://github.com/neovim","followers_url":"https://api.github.com/users/neovim/followers","following_url":"https://api.github.com/users/neovim/following{/other_user}","gists_url":"https://api.github.com/users/neovim/gists{/gist_id}","starred_url":"https://api.github.com/users/neovim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neovim/subscriptions","organizations_url":"https://api.github.com/users/neovim/orgs","repos_url":"https://api.github.com/users/neovim/repos","events_url":"https://api.github.com/users/neovim/events{/privacy}","received_events_url":"https://api.github.com/users/neovim/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/neovim/neovim","description":"Vim-fork focused on extensibility and agility.","fork":false,"url":"https://api.github.com/repos/neovim/neovim","forks_url":"https://api.github.com/repos/neovim/neovim/forks","keys_url":"https://api.github.com/repos/neovim/neovim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neovim/neovim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neovim/neovim/teams","hooks_url":"https://api.github.com/repos/neovim/neovim/hooks","issue_events_url":"https://api.github.com/repos/neovim/neovim/issues/events{/number}","events_url":"https://api.github.com/repos/neovim/neovim/events","assignees_url":"https://api.github.com/repos/neovim/neovim/assignees{/user}","branches_url":"https://api.github.com/repos/neovim/neovim/branches{/branch}","tags_url":"https://api.github.com/repos/neovim/neovim/tags","blobs_url":"https://api.github.com/repos/neovim/neovim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neovim/neovim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neovim/neovim/git/refs{/sha}","trees_url":"https://api.github.com/repos/neovim/neovim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neovim/neovim/statuses/{sha}","languages_url":"https://api.github.com/repos/neovim/neovim/languages","stargazers_url":"https://api.github.com/repos/neovim/neovim/stargazers","contributors_url":"https://api.github.com/repos/neovim/neovim/contributors","subscribers_url":"https://api.github.com/repos/neovim/neovim/subscribers","subscription_url":"https://api.github.com/repos/neovim/neovim/subscription","commits_url":"https://api.github.com/repos/neovim/neovim/commits{/sha}","git_commits_url":"https://api.github.com/repos/neovim/neovim/git/commits{/sha}","comments_url":"https://api.github.com/repos/neovim/neovim/comments{/number}","issue_comment_url":"https://api.github.com/repos/neovim/neovim/issues/comments{/number}","contents_url":"https://api.github.com/repos/neovim/neovim/contents/{+path}","compare_url":"https://api.github.com/repos/neovim/neovim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neovim/neovim/merges","archive_url":"https://api.github.com/repos/neovim/neovim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neovim/neovim/downloads","issues_url":"https://api.github.com/repos/neovim/neovim/issues{/number}","pulls_url":"https://api.github.com/repos/neovim/neovim/pulls{/number}","milestones_url":"https://api.github.com/repos/neovim/neovim/milestones{/number}","notifications_url":"https://api.github.com/repos/neovim/neovim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neovim/neovim/labels{/name}","releases_url":"https://api.github.com/repos/neovim/neovim/releases{/id}","deployments_url":"https://api.github.com/repos/neovim/neovim/deployments","created_at":"2014-01-31T13:39:22Z","updated_at":"2016-06-14T10:55:51Z","pushed_at":"2016-06-13T23:39:59Z","git_url":"git://github.com/neovim/neovim.git","ssh_url":"git@github.com:neovim/neovim.git","clone_url":"https://github.com/neovim/neovim.git","svn_url":"https://github.com/neovim/neovim","homepage":"https://salt.bountysource.com/teams/neovim","size":69330,"stargazers_count":19013,"watchers_count":19013,"language":"VimL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1339,"mirror_url":null,"open_issues_count":706,"forks":1339,"open_issues":706,"watchers":19013,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/neovim/neovim/pulls/4915"},"html":{"href":"https://github.com/neovim/neovim/pull/4915"},"issue":{"href":"https://api.github.com/repos/neovim/neovim/issues/4915"},"comments":{"href":"https://api.github.com/repos/neovim/neovim/issues/4915/comments"},"review_comments":{"href":"https://api.github.com/repos/neovim/neovim/pulls/4915/comments"},"review_comment":{"href":"https://api.github.com/repos/neovim/neovim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/neovim/neovim/pulls/4915/commits"},"statuses":{"href":"https://api.github.com/repos/neovim/neovim/statuses/5b116a5e4a89c69bf319550cd3e0bf7aef076b9c"}}}}
{"actor":{"display_login":"bfredl"}}