@@ -17,23 +17,23 @@ function docs.setup()
17
17
autocomplete .listen_on_position_update (function ()
18
18
if autocomplete .win :is_open () then docs .update_position () end
19
19
end )
20
- if config . auto_show then
21
- local timer = vim .uv .new_timer ()
22
- local last_context_id = nil
23
- autocomplete .listen_on_select (function (item , context )
24
- timer :stop ()
25
- if docs .win :is_open () or context .id == last_context_id then
26
- timer : start ( config . update_delay_ms , 0 , function ()
27
- vim . schedule ( function () docs . show_item ( item ) end )
28
- end )
29
- else
30
- timer : start ( config .auto_show_delay_ms , 0 , function ()
31
- last_context_id = context . id
32
- vim . schedule ( function () docs . show_item ( item ) end )
33
- end )
34
- end
35
- end )
36
- end
20
+
21
+ local timer = vim .uv .new_timer ()
22
+ local last_context_id = nil
23
+ autocomplete .listen_on_select (function (item , context )
24
+ timer :stop ()
25
+ if docs .win :is_open () or context .id == last_context_id then
26
+ last_context_id = context . id
27
+ timer : start ( config . update_delay_ms , 0 , function ()
28
+ vim . schedule ( function () docs . show_item ( item ) end )
29
+ end )
30
+ elseif config .auto_show then
31
+ timer : start ( config . auto_show_delay_ms , 0 , function ()
32
+ last_context_id = context . id
33
+ vim . schedule ( function () docs . show_item ( item ) end )
34
+ end )
35
+ end
36
+ end )
37
37
autocomplete .listen_on_close (function () docs .win :close () end )
38
38
39
39
return docs
@@ -56,7 +56,7 @@ function docs.show_item(item)
56
56
57
57
local doc_lines = {}
58
58
if item .detail and item .detail ~= ' ' then
59
- table.insert (doc_lines , ' ```' .. vim .bo .filetype )
59
+ table.insert (doc_lines , ' ```' .. vim .bo .filetype )
60
60
for s in item .detail :gmatch (' [^\r\n ]+' ) do
61
61
table.insert (doc_lines , s )
62
62
end
0 commit comments