{"action":"created","issue":{"url":"https://api.github.com/repos/zchee/deoplete-go/issues/7","labels_url":"https://api.github.com/repos/zchee/deoplete-go/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/zchee/deoplete-go/issues/7/comments","events_url":"https://api.github.com/repos/zchee/deoplete-go/issues/7/events","html_url":"https://github.com/zchee/deoplete-go/issues/7","id":127180931,"number":7,"title":"Bad completion behaviour without a \"omni_pattern\" like feature","user":{"login":"svanharmelen","id":4171547,"avatar_url":"https://avatars.githubusercontent.com/u/4171547?v=3","gravatar_id":"","url":"https://api.github.com/users/svanharmelen","html_url":"https://github.com/svanharmelen","followers_url":"https://api.github.com/users/svanharmelen/followers","following_url":"https://api.github.com/users/svanharmelen/following{/other_user}","gists_url":"https://api.github.com/users/svanharmelen/gists{/gist_id}","starred_url":"https://api.github.com/users/svanharmelen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svanharmelen/subscriptions","organizations_url":"https://api.github.com/users/svanharmelen/orgs","repos_url":"https://api.github.com/users/svanharmelen/repos","events_url":"https://api.github.com/users/svanharmelen/events{/privacy}","received_events_url":"https://api.github.com/users/svanharmelen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-01-18T08:57:16Z","updated_at":"2016-01-20T23:00:00Z","closed_at":null,"body":"The default behaviour you get when using `deoplete.nvim` with an `omni_pattern` for autocompleting Go code, was that the autocompletion would not start before you typed in the second character of a word.\r\n\r\nThis is because the default value of `g:deoplete#auto_completion_start_length` is set to 2. So if I would type `fm` it would now suggest `fmt`. This is perfectly fine and good behaviour, but now it's gone using this plugin.\r\n\r\nNow as soon as I change to `INSERT` mode, I get a whole list with completions, without even typing 1 single character:\r\n\r\n![example1](https://cloud.githubusercontent.com/assets/4171547/12386238/530a7686-bdc4-11e5-80b3-b72102ee30fb.gif)\r\n\r\nAs you can see I don't type anything, I just switch between `INSERT` and `NORMAL` mode and that gives me (unwanted) autocompletion suggestions. Now I know I can change this behaviour by setting `call deoplete#custom#set('go', 'min_pattern_length', 2)` which then gives me the old behaviour again:\r\n\r\n![example2](https://cloud.githubusercontent.com/assets/4171547/12386427/ccc64a44-bdc5-11e5-9ccf-a0a1ead32372.gif)\r\n\r\nAs you can see, this time switching modes doesn't trigger autocompletion, so I only get a suggestion when typing at least 2 characters (`fm` in this example).\r\n\r\nSo you would think things are good now, but they are not. Because now it doesn't complete again after typing a dot `.` until you again typed at least 2 characters :disappointed: :\r\n\r\n![example3](https://cloud.githubusercontent.com/assets/4171547/12386528/725d65d2-bdc6-11e5-9390-7ff611afaf74.gif)\r\n\r\nAs you can see now, I only get the second completion after typing `fmt.Pr` which is not what you want and expect.\r\n\r\nSo now I switched back to just using `deoplete.nvim` again by disabling the `deoplete-go` plugin and adding `g:deoplete#omni_patterns.go = '[^. *\\t]\\.\\w*'` to my `init.nvim`. This now restores the desired behaviour:\r\n\r\n![example4](https://cloud.githubusercontent.com/assets/4171547/12386678/8e91ca4e-bdc7-11e5-9a56-961378dea5f9.gif)\r\n\r\nAs you can see, this time I do not get suggestions when switching between `INSERT` and `NORMAL` mode, but only after typing 2 characters (`fm`) I get the first suggestion. When I then continue and type the dot `.` I immediately get a list with additional suggestions.\r\n\r\nNow I know that I actually get two different types of completion here. The first completion (for the `fm` part) was a `buffer` completion triggered by `g:deoplete#auto_completion_start_length`. And the second one (for the `fmt.` part) was the actual `omni` completion triggered by matching the `g:deoplete#omni_patterns.go` pattern.\r\n\r\nI think this is a very common and desired way of using the autocompletion, but currently I don't think this plugin offers this kind of behaviour. So I think that this plugin should be made a little bit smarter so it can have both a `min_pattern_length` *and* a `omni_pattern` which can both trigger the completion when either one of the configured values (either the length or the pattern) is matched.\r\n\r\nThanks!\r\n\r\n/ping @shougo"},"comment":{"url":"https://api.github.com/repos/zchee/deoplete-go/issues/comments/173392017","html_url":"https://github.com/zchee/deoplete-go/issues/7#issuecomment-173392017","issue_url":"https://api.github.com/repos/zchee/deoplete-go/issues/7","id":173392017,"user":{"login":"Shougo","id":41495,"avatar_url":"https://avatars.githubusercontent.com/u/41495?v=3","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":"2016-01-20T22:59:59Z","updated_at":"2016-01-20T22:59:59Z","body":"@zchee Hi, I have added `input_pattern` feature.   Deoplete-go should use it instead of min_pattern_length."}}