{"action":"created","issue":{"url":"https://api.github.com/repos/Shougo/deoplete.nvim/issues/705","repository_url":"https://api.github.com/repos/Shougo/deoplete.nvim","labels_url":"https://api.github.com/repos/Shougo/deoplete.nvim/issues/705/labels{/name}","comments_url":"https://api.github.com/repos/Shougo/deoplete.nvim/issues/705/comments","events_url":"https://api.github.com/repos/Shougo/deoplete.nvim/issues/705/events","html_url":"https://github.com/Shougo/deoplete.nvim/issues/705","id":308801138,"number":705,"title":"Remove duplicates if dup source","user":{"login":"Shougo","id":41495,"avatar_url":"https://avatars3.githubusercontent.com/u/41495?v=4","gravatar_id":"","url":"https://api.github.com/users/Shougo","html_url":"https://github.com/Shougo","followers_url":"https://api.github.com/users/Shougo/followers","following_url":"https://api.github.com/users/Shougo/following{/other_user}","gists_url":"https://api.github.com/users/Shougo/gists{/gist_id}","starred_url":"https://api.github.com/users/Shougo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shougo/subscriptions","organizations_url":"https://api.github.com/users/Shougo/orgs","repos_url":"https://api.github.com/users/Shougo/repos","events_url":"https://api.github.com/users/Shougo/events{/privacy}","received_events_url":"https://api.github.com/users/Shougo/received_events","type":"User","site_admin":false},"labels":[{"id":151938000,"url":"https://api.github.com/repos/Shougo/deoplete.nvim/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-03-27T02:37:22Z","updated_at":"2018-03-27T14:13:52Z","closed_at":"2018-03-27T13:40:29Z","author_association":"OWNER","body":"```diff\r\ndiff --git a/rplugin/python3/deoplete/child.py b/rplugin/python3/deoplete/child.py\r\nindex 6261870..4da3631 100644\r\n--- a/rplugin/python3/deoplete/child.py\r\n+++ b/rplugin/python3/deoplete/child.py\r\n@@ -157,16 +157,20 @@ class Child(logger.LoggingMixin):\r\n         merged_results = []\r\n         for result in [x for x in results\r\n                        if not self._is_skip(x['context'], x['source'])]:\r\n-            source_result = self._source_result(result, context['input'])\r\n-            if source_result:\r\n+            if self._update_result(result, context['input']):\r\n                 rank = get_custom(self._custom,\r\n                                   result['source'].name, 'rank',\r\n                                   result['source'].rank)\r\n+                dup = bool(result['source'].filetypes)\r\n+                candidates = result['candidates']\r\n+                if dup:\r\n+                    # Remove duplicates\r\n+                    candidates = sorted(set(candidates), key=candidates.index)\r\n                 merged_results.append({\r\n-                    'complete_position': source_result['complete_position'],\r\n+                    'complete_position': result['complete_position'],\r\n                     'mark': result['source'].mark,\r\n-                    'dup': bool(result['source'].filetypes),\r\n-                    'candidates': result['candidates'],\r\n+                    'dup': dup,\r\n+                    'candidates': candidates,\r\n                     'source_name': result['source'].name,\r\n                     'rank': rank,\r\n                 })\r\n@@ -302,7 +306,7 @@ class Child(logger.LoggingMixin):\r\n         except Exception:\r\n             error_tb(self._vim, 'Errors from: %s' % f)\r\n\r\n-    def _source_result(self, result, context_input):\r\n+    def _update_result(self, result, context_input):\r\n         source = result['source']\r\n\r\n         # Gather async results\r\n```"},"comment":{"url":"https://api.github.com/repos/Shougo/deoplete.nvim/issues/comments/376540556","html_url":"https://github.com/Shougo/deoplete.nvim/issues/705#issuecomment-376540556","issue_url":"https://api.github.com/repos/Shougo/deoplete.nvim/issues/705","id":376540556,"user":{"login":"Shougo","id":41495,"avatar_url":"https://avatars3.githubusercontent.com/u/41495?v=4","gravatar_id":"","url":"https://api.github.com/users/Shougo","html_url":"https://github.com/Shougo","followers_url":"https://api.github.com/users/Shougo/followers","following_url":"https://api.github.com/users/Shougo/following{/other_user}","gists_url":"https://api.github.com/users/Shougo/gists{/gist_id}","starred_url":"https://api.github.com/users/Shougo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Shougo/subscriptions","organizations_url":"https://api.github.com/users/Shougo/orgs","repos_url":"https://api.github.com/users/Shougo/repos","events_url":"https://api.github.com/users/Shougo/events{/privacy}","received_events_url":"https://api.github.com/users/Shougo/received_events","type":"User","site_admin":false},"created_at":"2018-03-27T14:13:52Z","updated_at":"2018-03-27T14:13:52Z","author_association":"OWNER","body":"@EdmundsEcho \r\n\r\n`$ cd ~/deoplete.nvim`\r\n`$  vim patch.diff`\r\n`$ patch -p1 <./patch.diff`"}}
{"actor":{"display_login":"Shougo"}}