payload: {"action":"created","comment":{"url":"https://api.github.com/repos/airblade/vim-gitgutter/pulls/comments/315081231","pull_request_review_id":276394646,"id":315081231,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMxNTA4MTIzMQ==","diff_hunk":"@@ -300,22 +300,47 @@ function! s:preview(hunk_diff)\n   let body_length = len(body)\n   let previewheight = min([body_length, &previewheight])\n \n-  silent! wincmd P\n-  if !&previewwindow\n-    noautocmd execute g:gitgutter_preview_win_location previewheight 'new'\n-    set previewwindow\n+  if has('nvim') && exists('*nvim_open_win')\n+    let buf = nvim_create_buf(v:false, v:false)\n+    let width = max(map(copy(lines), 'strdisplaywidth(v:val)'))\n+    let height = len(lines)\n+\n+    let s:floating_win = nvim_open_win(\n+          \\ buf, v:true, {\n+          \\   'width': width,\n+          \\   'height': height,\n+          \\   'relative': 'cursor',\n+          \\   'anchor': 'NW',\n+          \\   'row': 1,\n+          \\   'col': -1\n+          \\ })\n+\n+    setlocal nonumber norelativenumber signcolumn=no nofoldenable\n   else\n-    execute 'resize' previewheight\n+    silent! wincmd P\n+    if !&previewwindow\n+      noautocmd execute g:gitgutter_preview_win_location previewheight 'new'\n+      set previewwindow\n+    else\n+      execute 'resize' previewheight\n+    endif\n   endif\n \n   let b:hunk_header = header\n \n   setlocal noreadonly modifiable filetype=diff buftype=nofile bufhidden=delete noswapfile\n+  setlocal noreadonly modifiable filetype=diff buftype=nofile bufhidden=delete noswapfile nospell","path":"autoload/gitgutter/hunk.vim","position":38,"original_position":38,"commit_id":"0c2d514f66cc0d4886b849786f2d4b7f1f01f086","original_commit_id":"0c2d514f66cc0d4886b849786f2d4b7f1f01f086","user":{"login":"airblade","id":7265,"node_id":"MDQ6VXNlcjcyNjU=","avatar_url":"https://avatars0.githubusercontent.com/u/7265?v=4","gravatar_id":"","url":"https://api.github.com/users/airblade","html_url":"https://github.com/airblade","followers_url":"https://api.github.com/users/airblade/followers","following_url":"https://api.github.com/users/airblade/following{/other_user}","gists_url":"https://api.github.com/users/airblade/gists{/gist_id}","starred_url":"https://api.github.com/users/airblade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airblade/subscriptions","organizations_url":"https://api.github.com/users/airblade/orgs","repos_url":"https://api.github.com/users/airblade/repos","events_url":"https://api.github.com/users/airblade/events{/privacy}","received_events_url":"https://api.github.com/users/airblade/received_events","type":"User","site_admin":false},"body":"Why duplicate the line above just to add a keyword?","created_at":"2019-08-19T08:00:14Z","updated_at":"2019-08-19T08:00:14Z","html_url":"https://github.com/airblade/vim-gitgutter/pull/644#discussion_r315081231","pull_request_url":"https://api.github.com/repos/airblade/vim-gitgutter/pulls/644","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/airblade/vim-gitgutter/pulls/comments/315081231"},"html":{"href":"https://github.com/airblade/vim-gitgutter/pull/644#discussion_r315081231"},"pull_request":{"href":"https://api.github.com/repos/airblade/vim-gitgutter/pulls/644"}}},"pull_request":{"url":"https://api.github.com/repos/airblade/vim-gitgutter/pulls/644","id":308330761,"node_id":"MDExOlB1bGxSZXF1ZXN0MzA4MzMwNzYx","html_url":"https://github.com/airblade/vim-gitgutter/pull/644","diff_url":"https://github.com/airblade/vim-gitgutter/pull/644.diff","patch_url":"https://github.com/airblade/vim-gitgutter/pull/644.patch","issue_url":"https://api.github.com/repos/airblade/vim-gitgutter/issues/644","number":644,"state":"open","locked":false,"title":"Add neovim hunk preview floating window","user":{"login":"aymanbagabas","id":3187948,"node_id":"MDQ6VXNlcjMxODc5NDg=","avatar_url":"https://avatars1.githubusercontent.com/u/3187948?v=4","gravatar_id":"","url":"https://api.github.com/users/aymanbagabas","html_url":"https://github.com/aymanbagabas","followers_url":"https://api.github.com/users/aymanbagabas/followers","following_url":"https://api.github.com/users/aymanbagabas/following{/other_user}","gists_url":"https://api.github.com/users/aymanbagabas/gists{/gist_id}","starred_url":"https://api.github.com/users/aymanbagabas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aymanbagabas/subscriptions","organizations_url":"https://api.github.com/users/aymanbagabas/orgs","repos_url":"https://api.github.com/users/aymanbagabas/repos","events_url":"https://api.github.com/users/aymanbagabas/events{/privacy}","received_events_url":"https://api.github.com/users/aymanbagabas/received_events","type":"User","site_admin":false},"body":"This uses floating windows introduced in neovim to display hunks instead of\r\npreview windows. Requires nvim with floating windows.\r\n\r\nIf nvim is running and has floating window capabilities, display hunk\r\npreview in a floating window instead of a preview windows. Then a user\r\ncan focus to that floating window with Ctrl-w to be able to scroll if\r\nneeded to. Moving the cursor in the current buffer closes the floating\r\nwindow or `:q` inside the floating window.\r\n\r\n#643 \r\n\r\n![render1566093464359](https://user-images.githubusercontent.com/3187948/63219206-ce01d000-c13a-11e9-92c1-2b6ed6c47168.gif)\r\n\r\nI'm also using this in my config to override `diff` filetype background color.\r\n```\r\nhighlight DiffAdded ctermbg=none\r\nhighlight DiffRemoved ctermbg=none\r\n```","created_at":"2019-08-18T02:05:48Z","updated_at":"2019-08-19T08:00:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a92bc22dd6472276d57551f4bd26cdf7ff5c6cea","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/airblade/vim-gitgutter/pulls/644/commits","review_comments_url":"https://api.github.com/repos/airblade/vim-gitgutter/pulls/644/comments","review_comment_url":"https://api.github.com/repos/airblade/vim-gitgutter/pulls/comments{/number}","comments_url":"https://api.github.com/repos/airblade/vim-gitgutter/issues/644/comments","statuses_url":"https://api.github.com/repos/airblade/vim-gitgutter/statuses/0c2d514f66cc0d4886b849786f2d4b7f1f01f086","head":{"label":"aymanbagabas:preview-floating","ref":"preview-floating","sha":"0c2d514f66cc0d4886b849786f2d4b7f1f01f086","user":{"login":"aymanbagabas","id":3187948,"node_id":"MDQ6VXNlcjMxODc5NDg=","avatar_url":"https://avatars1.githubusercontent.com/u/3187948?v=4","gravatar_id":"","url":"https://api.github.com/users/aymanbagabas","html_url":"https://github.com/aymanbagabas","followers_url":"https://api.github.com/users/aymanbagabas/followers","following_url":"https://api.github.com/users/aymanbagabas/following{/other_user}","gists_url":"https://api.github.com/users/aymanbagabas/gists{/gist_id}","starred_url":"https://api.github.com/users/aymanbagabas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aymanbagabas/subscriptions","organizations_url":"https://api.github.com/users/aymanbagabas/orgs","repos_url":"https://api.github.com/users/aymanbagabas/repos","events_url":"https://api.github.com/users/aymanbagabas/events{/privacy}","received_events_url":"https://api.github.com/users/aymanbagabas/received_events","type":"User","site_admin":false},"repo":{"id":202946406,"node_id":"MDEwOlJlcG9zaXRvcnkyMDI5NDY0MDY=","name":"vim-gitgutter","full_name":"aymanbagabas/vim-gitgutter","private":false,"owner":{"login":"aymanbagabas","id":3187948,"node_id":"MDQ6VXNlcjMxODc5NDg=","avatar_url":"https://avatars1.githubusercontent.com/u/3187948?v=4","gravatar_id":"","url":"https://api.github.com/users/aymanbagabas","html_url":"https://github.com/aymanbagabas","followers_url":"https://api.github.com/users/aymanbagabas/followers","following_url":"https://api.github.com/users/aymanbagabas/following{/other_user}","gists_url":"https://api.github.com/users/aymanbagabas/gists{/gist_id}","starred_url":"https://api.github.com/users/aymanbagabas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aymanbagabas/subscriptions","organizations_url":"https://api.github.com/users/aymanbagabas/orgs","repos_url":"https://api.github.com/users/aymanbagabas/repos","events_url":"https://api.github.com/users/aymanbagabas/events{/privacy}","received_events_url":"https://api.github.com/users/aymanbagabas/received_events","type":"User","site_admin":false},"html_url":"https://github.com/aymanbagabas/vim-gitgutter","description":"A Vim plugin which shows a git diff in the gutter (sign column) and stages/undoes hunks.","fork":true,"url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter","forks_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/forks","keys_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/teams","hooks_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/hooks","issue_events_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/issues/events{/number}","events_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/events","assignees_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/assignees{/user}","branches_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/branches{/branch}","tags_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/tags","blobs_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/statuses/{sha}","languages_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/languages","stargazers_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/stargazers","contributors_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/contributors","subscribers_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/subscribers","subscription_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/subscription","commits_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/contents/{+path}","compare_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/merges","archive_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/downloads","issues_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/issues{/number}","pulls_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/pulls{/number}","milestones_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/milestones{/number}","notifications_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/labels{/name}","releases_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/releases{/id}","deployments_url":"https://api.github.com/repos/aymanbagabas/vim-gitgutter/deployments","created_at":"2019-08-18T01:19:15Z","updated_at":"2019-08-18T01:19:17Z","pushed_at":"2019-08-18T02:12:44Z","git_url":"git://github.com/aymanbagabas/vim-gitgutter.git","ssh_url":"git@github.com:aymanbagabas/vim-gitgutter.git","clone_url":"https://github.com/aymanbagabas/vim-gitgutter.git","svn_url":"https://github.com/aymanbagabas/vim-gitgutter","homepage":"","size":616,"stargazers_count":0,"watchers_count":0,"language":"Vim script","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"airblade:master","ref":"master","sha":"46f15ed42ad987b003ef5e81ec114c748c73ea89","user":{"login":"airblade","id":7265,"node_id":"MDQ6VXNlcjcyNjU=","avatar_url":"https://avatars0.githubusercontent.com/u/7265?v=4","gravatar_id":"","url":"https://api.github.com/users/airblade","html_url":"https://github.com/airblade","followers_url":"https://api.github.com/users/airblade/followers","following_url":"https://api.github.com/users/airblade/following{/other_user}","gists_url":"https://api.github.com/users/airblade/gists{/gist_id}","starred_url":"https://api.github.com/users/airblade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airblade/subscriptions","organizations_url":"https://api.github.com/users/airblade/orgs","repos_url":"https://api.github.com/users/airblade/repos","events_url":"https://api.github.com/users/airblade/events{/privacy}","received_events_url":"https://api.github.com/users/airblade/received_events","type":"User","site_admin":false},"repo":{"id":8310356,"node_id":"MDEwOlJlcG9zaXRvcnk4MzEwMzU2","name":"vim-gitgutter","full_name":"airblade/vim-gitgutter","private":false,"owner":{"login":"airblade","id":7265,"node_id":"MDQ6VXNlcjcyNjU=","avatar_url":"https://avatars0.githubusercontent.com/u/7265?v=4","gravatar_id":"","url":"https://api.github.com/users/airblade","html_url":"https://github.com/airblade","followers_url":"https://api.github.com/users/airblade/followers","following_url":"https://api.github.com/users/airblade/following{/other_user}","gists_url":"https://api.github.com/users/airblade/gists{/gist_id}","starred_url":"https://api.github.com/users/airblade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/airblade/subscriptions","organizations_url":"https://api.github.com/users/airblade/orgs","repos_url":"https://api.github.com/users/airblade/repos","events_url":"https://api.github.com/users/airblade/events{/privacy}","received_events_url":"https://api.github.com/users/airblade/received_events","type":"User","site_admin":false},"html_url":"https://github.com/airblade/vim-gitgutter","description":"A Vim plugin which shows a git diff in the gutter (sign column) and stages/undoes hunks.","fork":false,"url":"https://api.github.com/repos/airblade/vim-gitgutter","forks_url":"https://api.github.com/repos/airblade/vim-gitgutter/forks","keys_url":"https://api.github.com/repos/airblade/vim-gitgutter/keys{/key_id}","collaborators_url":"https://api.github.com/repos/airblade/vim-gitgutter/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/airblade/vim-gitgutter/teams","hooks_url":"https://api.github.com/repos/airblade/vim-gitgutter/hooks","issue_events_url":"https://api.github.com/repos/airblade/vim-gitgutter/issues/events{/number}","events_url":"https://api.github.com/repos/airblade/vim-gitgutter/events","assignees_url":"https://api.github.com/repos/airblade/vim-gitgutter/assignees{/user}","branches_url":"https://api.github.com/repos/airblade/vim-gitgutter/branches{/branch}","tags_url":"https://api.github.com/repos/airblade/vim-gitgutter/tags","blobs_url":"https://api.github.com/repos/airblade/vim-gitgutter/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/airblade/vim-gitgutter/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/airblade/vim-gitgutter/git/refs{/sha}","trees_url":"https://api.github.com/repos/airblade/vim-gitgutter/git/trees{/sha}","statuses_url":"https://api.github.com/repos/airblade/vim-gitgutter/statuses/{sha}","languages_url":"https://api.github.com/repos/airblade/vim-gitgutter/languages","stargazers_url":"https://api.github.com/repos/airblade/vim-gitgutter/stargazers","contributors_url":"https://api.github.com/repos/airblade/vim-gitgutter/contributors","subscribers_url":"https://api.github.com/repos/airblade/vim-gitgutter/subscribers","subscription_url":"https://api.github.com/repos/airblade/vim-gitgutter/subscription","commits_url":"https://api.github.com/repos/airblade/vim-gitgutter/commits{/sha}","git_commits_url":"https://api.github.com/repos/airblade/vim-gitgutter/git/commits{/sha}","comments_url":"https://api.github.com/repos/airblade/vim-gitgutter/comments{/number}","issue_comment_url":"https://api.github.com/repos/airblade/vim-gitgutter/issues/comments{/number}","contents_url":"https://api.github.com/repos/airblade/vim-gitgutter/contents/{+path}","compare_url":"https://api.github.com/repos/airblade/vim-gitgutter/compare/{base}...{head}","merges_url":"https://api.github.com/repos/airblade/vim-gitgutter/merges","archive_url":"https://api.github.com/repos/airblade/vim-gitgutter/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/airblade/vim-gitgutter/downloads","issues_url":"https://api.github.com/repos/airblade/vim-gitgutter/issues{/number}","pulls_url":"https://api.github.com/repos/airblade/vim-gitgutter/pulls{/number}","milestones_url":"https://api.github.com/repos/airblade/vim-gitgutter/milestones{/number}","notifications_url":"https://api.github.com/repos/airblade/vim-gitgutter/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/airblade/vim-gitgutter/labels{/name}","releases_url":"https://api.github.com/repos/airblade/vim-gitgutter/releases{/id}","deployments_url":"https://api.github.com/repos/airblade/vim-gitgutter/deployments","created_at":"2013-02-20T09:54:02Z","updated_at":"2019-08-19T05:01:06Z","pushed_at":"2019-08-18T02:12:45Z","git_url":"git://github.com/airblade/vim-gitgutter.git","ssh_url":"git@github.com:airblade/vim-gitgutter.git","clone_url":"https://github.com/airblade/vim-gitgutter.git","svn_url":"https://github.com/airblade/vim-gitgutter","homepage":"","size":615,"stargazers_count":5802,"watchers_count":5802,"language":"Vim script","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":230,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":8,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":230,"open_issues":8,"watchers":5802,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/airblade/vim-gitgutter/pulls/644"},"html":{"href":"https://github.com/airblade/vim-gitgutter/pull/644"},"issue":{"href":"https://api.github.com/repos/airblade/vim-gitgutter/issues/644"},"comments":{"href":"https://api.github.com/repos/airblade/vim-gitgutter/issues/644/comments"},"review_comments":{"href":"https://api.github.com/repos/airblade/vim-gitgutter/pulls/644/comments"},"review_comment":{"href":"https://api.github.com/repos/airblade/vim-gitgutter/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/airblade/vim-gitgutter/pulls/644/commits"},"statuses":{"href":"https://api.github.com/repos/airblade/vim-gitgutter/statuses/0c2d514f66cc0d4886b849786f2d4b7f1f01f086"}},"author_association":"NONE"}}
other: {"actor":{"display_login":"airblade"}}